exports.CheckPassword("Ender","plaintextpassword",callback)
function callback(err, result) {
if (err) {
exports.Error("Password test " + err);
} else {
console.log("Password test " + result);
}
}
When using callback(true) in the callback function it errors when it doesnt in the CheckPassword function
The error
>Solution :
Your method is expecting error as first argument and result as second.
When you pass true to your callback it understand error as true.
Ideally, it should expect result first and error as an optional argument
function callback(result, err) {// remaining code will ve as it it}