Merge pull request #56 from wodka/bugfix/bcrypt_error
bugfix hashPassword call that is made with null
This commit is contained in:
commit
c48ef4adca
@ -110,7 +110,7 @@ UserSchema.virtual('password').get(function () {
|
|||||||
* Create instance method for hashing a password
|
* Create instance method for hashing a password
|
||||||
*/
|
*/
|
||||||
UserSchema.statics.hashPassword = UserSchema.methods.hashPassword = function(password) {
|
UserSchema.statics.hashPassword = UserSchema.methods.hashPassword = function(password) {
|
||||||
return bcrypt.hashSync(password, 4);
|
return password ? bcrypt.hashSync(password, 4) : false;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user