Im trying to do a basic authentication using nodejs and mongoose. When i post at the authentication route, isMatch returns false for the user password. I can't even say this is the broken part of the code, can someone guide me out?
userSchema.methods.comparePassword = function(passw, cb) {
bcrypt.compare(passw, this.password, function(err, isMatch) {
if (err) {
return cb(err);
}
cb(null, isMatch);
});
};
via GreetingsFriend
No comments:
Post a Comment