This commit is contained in:
Blade Barringer
2015-11-12 12:52:35 -06:00
parent 431bbd762f
commit abe778836d

View File

@@ -103,11 +103,13 @@ api.registerUser = function(req, res, next) {
hashed_password: utils.encryptPassword(req.body.password, salt)
},
timestamps: {created: +new Date(), loggedIn: +new Date()}
}
},
registeredThrough: req.headers['x-client']
};
// existing user, allow them to add local authentication
if (data.findFacebook) {
data.findFacebook.auth.local = newUser.auth.local;
data.findFacebook.registeredThrough = newUser.registeredThrough;
data.findFacebook.save(cb);
// new user, register them
} else {
@@ -123,8 +125,6 @@ api.registerUser = function(req, res, next) {
};
analytics.track('register', analyticsData)
user.registeredThrough = req.headers['x-client']
user.save(function(err, savedUser){
// Clean previous email preferences
// TODO when emails added to EmailUnsubcription they should use lowercase version