From 33a3d71c93e234504133174d69ee05c61b778d84 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Tue, 24 Sep 2024 17:47:30 +0530 Subject: [PATCH] feat: use comparePassword from utils --- server/src/models/User.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/models/User.ts b/server/src/models/User.ts index 878c5656..7227accb 100644 --- a/server/src/models/User.ts +++ b/server/src/models/User.ts @@ -1,7 +1,7 @@ import { DataTypes, Model, Optional } from 'sequelize'; import bcrypt from 'bcrypt'; import sequelize from '../db/config'; -import { hashPassword } from '../utils/auth'; +import { hashPassword, comparePassword } from '../utils/auth'; interface UserAttributes { id: number; @@ -18,7 +18,7 @@ class User extends Model implements User public password!: string; public async isValidPassword(password: string): Promise { - return bcrypt.compare(password, this.password); + return comparePassword(password, this.password); } }