src/models/user.js
function comparePassword(candidatePassword, callback) {
  bcrypt.compare(candidatePassword, this.password, (err, isMatch) => {
    if (err) {
      return callback(err);
    }

    callback(null, isMatch);
  });
}
function comparePassword(candidatePassword, callback) {
  bcrypt.compare(candidatePassword, this.password, (err, isMatch) => {
    if (err) {
      return callback(err);
    }

    callback(null, isMatch);
  });
}
function comparePassword ( candidatePassword , callback ) { bcrypt . compare ( candidatePassword , this . password , ( err , isMatch ) => { if ( err ) { return callback ( err ) ; } callback ( null , isMatch ) ; } ) ; }
Compare user entered password with stored user's password
@param  {String}   candidatePassword
@param  {Function} callback
Compare user entered password with stored user s password