mirror of
https://github.com/Ravinou/borgwarehouse
synced 2024-06-04 06:52:30 +02:00
12 lines
348 B
JavaScript
12 lines
348 B
JavaScript
|
// This function is used to hash user passwords and to verify them with the bcryptjs library
|
||
|
//Lib
|
||
|
import { hash, compare } from 'bcryptjs';
|
||
|
|
||
|
export async function hashPassword(password) {
|
||
|
return await hash(password, 12);
|
||
|
}
|
||
|
|
||
|
export async function verifyPassword(password, hashedPassword) {
|
||
|
return await compare(password, hashedPassword);
|
||
|
}
|