UNPKG

feathers-authentication-management

Version:

Adds sign up verification, forgotten password reset, and other capabilities to local feathers-authentication

13 lines (9 loc) 327 B
const bcrypt = require('bcryptjs'); module.exports = comparePasswords; function comparePasswords (oldPassword, password, getError) { return new Promise((resolve, reject) => { bcrypt.compare(oldPassword, password, (err, data1) => (err || !data1) ? reject(getError() || err) : resolve() ); }); }