Initial commit
This commit is contained in:
9
lib/auth/password.ts
Normal file
9
lib/auth/password.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import bcrypt from "bcryptjs";
|
||||
|
||||
export async function hashPassword(pw: string) {
|
||||
return bcrypt.hash(pw, 10);
|
||||
}
|
||||
|
||||
export async function verifyPassword(pw: string, hash: string) {
|
||||
return bcrypt.compare(pw, hash);
|
||||
}
|
||||
Reference in New Issue
Block a user