You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
app.post('/login', function (req, res, next) { var user = {}; db.collection('users', function (err, collection) { collection.findOne({ login: req.body.login, }, function (err, result) { if (result && req.body.password) { if (bcrypt.compareSync(req.body.password, result.password)) { user = result; } } }); }); });
im having trouble with the comparePassword function,
i try to authenticate via Post and I get a error
Im using the latest npm package
module.exports.comparePassword = function(candidatePassword, hash, callback){ bcrypt.compare(candidatePassword, hash, (err, isMatch) => { if(err) throw err; callback(null, isMatch); }); }
The text was updated successfully, but these errors were encountered: