@foal/core
Version:
Full-featured Node.js framework, with no complexity
18 lines (17 loc) • 774 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.verifyPassword = verifyPassword;
const password_service_1 = require("./password.service");
/**
* Compare a plain text password and a hash to see if they match.
*
* @deprecated Use `PasswordService.verifyPassword()` instead.
* @export
* @param {string} plainTextPassword - The password in clear text.
* @param {string} passwordHash - The password hash generated by the `hashPassword` function.
* @returns {Promise<boolean>} True if the hash and the password match. False otherwise.
*/
async function verifyPassword(plainTextPassword, passwordHash) {
const service = new password_service_1.PasswordService();
return service.verifyPassword(plainTextPassword, passwordHash);
}