add externalized hashPassword.js

This commit is contained in:
2023-07-23 12:22:58 +02:00
parent f918adf22a
commit 021e9aa940
2 changed files with 11 additions and 10 deletions

View File

@@ -0,0 +1,10 @@
import { hash } from 'argon2'
export async function hashPassword(password, salt) {
try {
const hashedPassword = await hash(password, salt); // Hash the password with the salt and pepper
return hashedPassword;
} catch (error) {
console.error('Error hashing password:', error);
}
}