mirror of
https://github.com/LucasVbr/meeting-app.git
synced 2026-07-09 15:08:06 +00:00
Fix hash password
Took 30 minutes
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import bcrypt from "bcrypt";
|
||||
|
||||
export async function hashPassword(unHashedPassword: string): Promise<string> {
|
||||
return await bcrypt.hash(unHashedPassword, 10).then((hash: string) => hash);
|
||||
}
|
||||
|
||||
export async function isSamePassword(
|
||||
unHashedPassword: string,
|
||||
hashedPassword: string
|
||||
): Promise<boolean> {
|
||||
return await bcrypt.compare(unHashedPassword, hashedPassword).
|
||||
then((result: boolean) => result);
|
||||
}
|
||||
Reference in New Issue
Block a user