Next.js template
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hashPasswordHelpers.js 313B

1234567891011
  1. import { hash, compare } from "bcryptjs";
  2. export async function hashPassword(password) {
  3. const hashedPassword = await hash(password, 12);
  4. return hashedPassword;
  5. }
  6. export async function verifyPassword(password, hashedPassword) {
  7. const isValid = await compare(password, hashedPassword);
  8. return isValid;
  9. }