From: charleswrayjr Date: Sat, 13 Sep 2025 14:08:51 +0000 (-0500) Subject: Adding auth, media, and messaging. X-Git-Url: https://git.phasecustomsoft.com/static/gitweb.css?a=commitdiff_plain;h=2f5af93ba1f7a5e09f82f50cb6c78c494d7790a6;p=phs-api.git Adding auth, media, and messaging. --- diff --git a/src/models/user.model.js b/src/models/user.model.js index 13e16fa..5e8390e 100644 --- a/src/models/user.model.js +++ b/src/models/user.model.js @@ -46,8 +46,9 @@ class User extends Model { this.base_query = ` SELECT u.id, u.email, u.first_name, u.middle_name, u.last_name, u.initials, u.nickname, u.created_by_id, u.created_at, u.is_deleted, u.deleted_by_id, u.deleted_at, - u.is_active, u.deactivated_by_id, u.deactivated_at + u.is_active, u.deactivated_by_id, u.deactivated_at, a.password, a.password_salt FROM phase.users u + inner join phase.authentication a on u.id = a.user_id `; this.base_list_query = ` SELECT u.id, u.email, u.first_name, u.middle_name, u.last_name, u.initials, u.nickname, @@ -145,12 +146,11 @@ class User extends Model { }); } - async comparePassword(password, auth) { - logger.warn(auth); + async comparePassword(password) { logger.warn(password); - logger.warn(auth.password); - logger.warn(bcrypt.compareSync(password, auth.password)); - return auth ? bcrypt.compareSync(password, auth.password) : false; + logger.warn(this.password); + logger.warn(bcrypt.compareSync(password, this.password)); + return password ? bcrypt.compareSync(password, this.password) : false; } async createToken() {