karbe/src/lib/password.ts
Karbé Architect 88a7d01d55 feat(auth): add multi-role NextAuth with role guards
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-29 10:46:54 +00:00

12 lines
338 B
TypeScript

import bcrypt from "bcryptjs";
export async function verifyPassword(
plainTextPassword: string,
hashedPassword: string,
): Promise<boolean> {
return bcrypt.compare(plainTextPassword, hashedPassword);
}
export async function hashPassword(plainTextPassword: string): Promise<string> {
return bcrypt.hash(plainTextPassword, 12);
}