feat: some changes and admin
This commit is contained in:
11
nextjs/src/lib/auth/password.ts
Normal file
11
nextjs/src/lib/auth/password.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import bcrypt from 'bcryptjs';
|
||||
|
||||
const SALT_ROUNDS = 12;
|
||||
|
||||
export function hashPassword(plain: string): string {
|
||||
return bcrypt.hashSync(plain, SALT_ROUNDS);
|
||||
}
|
||||
|
||||
export function verifyPassword(plain: string, passwordHash: string): boolean {
|
||||
return bcrypt.compareSync(plain, passwordHash);
|
||||
}
|
||||
Reference in New Issue
Block a user