fase(9): auth module with casl rbac and session management
This commit is contained in:
14
dist/modules/auth/infrastructure/auth/PasswordService.js
vendored
Normal file
14
dist/modules/auth/infrastructure/auth/PasswordService.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hashPassword = hashPassword;
|
||||
exports.verifyPassword = verifyPassword;
|
||||
const argon2_1 = __importDefault(require("argon2"));
|
||||
async function hashPassword(password) {
|
||||
return argon2_1.default.hash(password);
|
||||
}
|
||||
async function verifyPassword(password, hash) {
|
||||
return argon2_1.default.verify(hash, password);
|
||||
}
|
||||
Reference in New Issue
Block a user