Merge pull request #56 from wodka/bugfix/bcrypt_error

bugfix hashPassword call that is made with null
This commit is contained in:
Michael Schramm 2019-10-10 15:21:24 +02:00 committed by GitHub
commit c48ef4adca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,7 +110,7 @@ UserSchema.virtual('password').get(function () {
* Create instance method for hashing a password
*/
UserSchema.statics.hashPassword = UserSchema.methods.hashPassword = function(password) {
return bcrypt.hashSync(password, 4);
return password ? bcrypt.hashSync(password, 4) : false;
};
/**