function checkPassword(password) {
  return new Promise((resolve, reject) => {
    bcrypt.compare(password, this.password, function(error, result) {
      if (error)
        reject(error);
      else
        resolve(result);
    });
  });
}
/**
 * Check this user's password hash against a provided plain text password.
 *
 * @param {String} password
 *  plain text password
 * @returns {Promise}
 *  promise that resolves true/false, or rejects if bcrypt library returns
 *  an error.
 * @memberof User
 * @instance
 */
Check this user's password hash against a provided plain text password.
@param {String} password
plain text password
@returns {Promise}
promise that resolves true/false, or rejects if bcrypt library returns
an error.
@memberof User
@instance
Check this user ' s password hash against a provided plain text password . @param { String } password plain text password @returns { Promise } promise that resolves true / false or rejects if bcrypt library returns an error . @memberof User @instance
function checkPassword(password) {
  return new Promise((resolve, reject) => {
    bcrypt.compare(password, this.password, function(error, result) {
      if (error)
        reject(error);
      else
        resolve(result);
    });
  });
}
function checkPassword ( password ) { return new Promise ( ( resolve , reject ) => { bcrypt . compare ( password , this . password , function ( error , result ) { if ( error ) reject ( error ) ; else resolve ( result ) ; } ) ; } ) ; }
Check this user's password hash against a provided plain text password.
Check this user ' s password hash against a provided plain text password .