feat(backend): add fastify api, auth, prisma schema and jobs
This commit is contained in:
11
apps/backend/src/utils/password.ts
Normal file
11
apps/backend/src/utils/password.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import bcrypt from 'bcryptjs';
|
||||
|
||||
export const BCRYPT_ROUNDS = 12;
|
||||
|
||||
export async function hashPassword(plain: string): Promise<string> {
|
||||
return bcrypt.hash(plain, BCRYPT_ROUNDS);
|
||||
}
|
||||
|
||||
export async function verifyPassword(plain: string, hash: string): Promise<boolean> {
|
||||
return bcrypt.compare(plain, hash);
|
||||
}
|
||||
Reference in New Issue
Block a user