mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-05 10:36:06 -06:00
Co-authored-by: jonas.hoebenreich <jonas.hoebenreich@flixbus.com> Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
12 lines
337 B
TypeScript
12 lines
337 B
TypeScript
import { compare, hash } from "bcryptjs";
|
|
|
|
export async function hashPassword(password: string) {
|
|
const hashedPassword = await hash(password, 12);
|
|
return hashedPassword;
|
|
}
|
|
|
|
export async function verifyPassword(password: string, hashedPassword: string) {
|
|
const isValid = await compare(password, hashedPassword);
|
|
return isValid;
|
|
}
|