mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Fixes #6225
This commit is contained in:
@@ -103,11 +103,13 @@ api.registerUser = function(req, res, next) {
|
|||||||
hashed_password: utils.encryptPassword(req.body.password, salt)
|
hashed_password: utils.encryptPassword(req.body.password, salt)
|
||||||
},
|
},
|
||||||
timestamps: {created: +new Date(), loggedIn: +new Date()}
|
timestamps: {created: +new Date(), loggedIn: +new Date()}
|
||||||
}
|
},
|
||||||
|
registeredThrough: req.headers['x-client']
|
||||||
};
|
};
|
||||||
// existing user, allow them to add local authentication
|
// existing user, allow them to add local authentication
|
||||||
if (data.findFacebook) {
|
if (data.findFacebook) {
|
||||||
data.findFacebook.auth.local = newUser.auth.local;
|
data.findFacebook.auth.local = newUser.auth.local;
|
||||||
|
data.findFacebook.registeredThrough = newUser.registeredThrough;
|
||||||
data.findFacebook.save(cb);
|
data.findFacebook.save(cb);
|
||||||
// new user, register them
|
// new user, register them
|
||||||
} else {
|
} else {
|
||||||
@@ -123,8 +125,6 @@ api.registerUser = function(req, res, next) {
|
|||||||
};
|
};
|
||||||
analytics.track('register', analyticsData)
|
analytics.track('register', analyticsData)
|
||||||
|
|
||||||
user.registeredThrough = req.headers['x-client']
|
|
||||||
|
|
||||||
user.save(function(err, savedUser){
|
user.save(function(err, savedUser){
|
||||||
// Clean previous email preferences
|
// Clean previous email preferences
|
||||||
// TODO when emails added to EmailUnsubcription they should use lowercase version
|
// TODO when emails added to EmailUnsubcription they should use lowercase version
|
||||||
|
|||||||
Reference in New Issue
Block a user