This question already has an answer here:
UserSchema.methods.verifyPassword = (password, cb) => {
bcrypt.compare(password, this.password, (err, isMatch) => {
if (err) return cb(err)
cb(null, isMatch)
})
}
Returns "Incorrect arguments" when using the method while
UserSchema.methods.verifyPassword = function(password, cb) {
bcrypt.compare(password, this.password, (err, isMatch) => {
if (err) return cb(err)
cb(null, isMatch)
})
}
Works as expected....
Am I declaring the function for the method wrong?
via mikethehud
No comments:
Post a Comment