refactor(auth): added in correct bycrptjs

This commit is contained in:
2025-03-22 10:04:14 -05:00
parent e82ef76316
commit 208cd615af
2 changed files with 26 additions and 24 deletions

View File

@@ -1,17 +1,17 @@
import bcrypt from "bcrypt";
import bcrypt from "bcryptjs";
export const createPassword = async (password: string) => {
// encypt password
let pass: string | undefined = process.env.SECRET;
let salt: string | undefined = process.env.SALTING;
// encypt password
let pass: string | undefined = process.env.SECRET;
let salt: string | undefined = process.env.SALTING;
if (!pass || !salt) {
pass = "error";
} else {
pass = bcrypt.hashSync(pass + password, parseInt(salt));
if (!pass || !salt) {
pass = "error";
} else {
pass = bcrypt.hashSync(pass + password, parseInt(salt));
pass = btoa(pass);
}
pass = btoa(pass);
}
return pass;
return pass;
};