From b528efa75e6176f2b2a58b831a8db8c59f5de2af Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Wed, 25 Sep 2024 18:36:12 +0530 Subject: [PATCH] feat: remove logic for hashing & comparsion from User model --- server/src/models/User.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/server/src/models/User.ts b/server/src/models/User.ts index 67b944b9..f51177a1 100644 --- a/server/src/models/User.ts +++ b/server/src/models/User.ts @@ -15,10 +15,6 @@ class User extends Model implements User public id!: number; public email!: string; public password!: string; - - public async isValidPassword(password: string): Promise { - return comparePassword(password, this.password); - } } User.init( @@ -44,13 +40,6 @@ User.init( { sequelize, tableName: 'user', - hooks: { - beforeCreate: async (user: User) => { - if (user.password) { - user.password = await hashPassword(user.password) as string; - } - }, - }, } );