Files
formbricks-formbricks/apps/web/modules/auth/lib/utils.ts
Dhruwang Jariwala f80d1b32b7 chore: Auth module revamp (#4335)
Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com>
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
2024-11-26 08:28:13 +00:00

12 lines
345 B
TypeScript

import { compare, hash } from "bcryptjs";
export const hashPassword = async (password: string) => {
const hashedPassword = await hash(password, 12);
return hashedPassword;
};
export const verifyPassword = async (password: string, hashedPassword: string) => {
const isValid = await compare(password, hashedPassword);
return isValid;
};