narinder1231 commited on
Commit
3871436
·
1 Parent(s): 04e045d

create function to campare hashed password

Browse files
Files changed (1) hide show
  1. src/utils/passwordUtils.ts +4 -0
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
+ }