From 05442af05033324f6b1e53607dc1546152d323d1 Mon Sep 17 00:00:00 2001 From: gorkem-bwl Date: Thu, 11 Sep 2025 23:55:58 -0400 Subject: [PATCH] fix: apply prettier formatting to userService.js - Fixed all prettier formatting issues in userService.js - All files now pass prettier format check - Maintained null checks and error handling improvements --- server/src/service/business/userService.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/service/business/userService.js b/server/src/service/business/userService.js index 612f97a5a..1e9abe4b2 100644 --- a/server/src/service/business/userService.js +++ b/server/src/service/business/userService.js @@ -85,12 +85,12 @@ class UserService { // Check if user exists try { const user = await this.db.userModule.getUserByEmail(email); - + // Add null check before password comparison if (!user || !user.comparePassword) { throw this.errorService.createAuthenticationError(this.stringService.authIncorrectPassword); } - + // Compare password const match = await user.comparePassword(password); if (match !== true) { @@ -117,7 +117,7 @@ class UserService { error: error.message, stack: error.stack, }); - + // If user is not found, throw a generic authentication error for security // Don't reveal whether user exists or password is wrong throw this.errorService.createAuthenticationError(this.stringService.authIncorrectPassword); @@ -132,12 +132,12 @@ class UserService { updates.email = currentUser.email; // Get user const user = await this.db.userModule.getUserByEmail(currentUser.email); - + // Add null check before password comparison if (!user || !user.comparePassword) { throw this.errorService.createAuthorizationError(this.stringService.authIncorrectPassword); } - + // Compare passwords const match = await user.comparePassword(updates?.password); // If not a match, throw a 403