Spaces:
Runtime error
Runtime error
Commit ·
3871436
1
Parent(s): 04e045d
create function to campare hashed password
Browse files
src/utils/passwordUtils.ts
CHANGED
|
@@ -5,3 +5,7 @@ export const hashPassword = async (password: string) => {
|
|
| 5 |
const hashedPassword = await bcrypt.hash(password, salt);
|
| 6 |
return hashedPassword;
|
| 7 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
const hashedPassword = await bcrypt.hash(password, salt);
|
| 6 |
return hashedPassword;
|
| 7 |
}
|
| 8 |
+
|
| 9 |
+
export const comparePassword = async (password: string, hashedPassword: string) => {
|
| 10 |
+
return await bcrypt.compare(password, hashedPassword);
|
| 11 |
+
}
|