function validateLogin(username,passwordPlaintext) {
db.collection('users').findOne({"username": username}, (function(err, user) {
return bcrypt.compareSync(passwordPlaintext, user.passwordHash);
});
}
This is my current code. It receives a username and plaintext password and then hashes the password and compares it to the database. Using console.log, I've verified that everything works, but I can't figure out how to return the boolean that bcrypt produces from validateLogin().