fix(users): user passowrd & salt value lose

This commit is contained in:
OldHawk
2017-05-27 17:15:50 +08:00
parent c11a13de25
commit 2b75fb9e72

View File

@@ -261,8 +261,9 @@ UserSchema.methods.hashPassword = function (password) {
* update user last signed time
*/
UserSchema.methods.updateSignedTime = function () {
this.last_signed = Date.now();
this.save();
this.update({
$set: {last_signed: Date.now()}
}).exec();
};
/**