From 99c5251a0ba8f44bb4d85fae1ed16e62cfbddcde Mon Sep 17 00:00:00 2001 From: TVATDCI Date: Thu, 12 Feb 2026 04:28:09 +0100 Subject: [PATCH 1/2] remove next parameter from async --- backend/models/userModel.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/backend/models/userModel.js b/backend/models/userModel.js index 7a0f655..7bd3a7d 100644 --- a/backend/models/userModel.js +++ b/backend/models/userModel.js @@ -36,17 +36,11 @@ const userSchema = new mongoose.Schema( ); // Hash password before saving -userSchema.pre('save', async function (next) { - if (!this.isModified('password')) return next(); +userSchema.pre('save', async function () { + if (!this.isModified('password')) return; - try { - const salt = await bcrypt.genSalt(10); - this.password = await bcrypt.hash(this.password, salt); - next(); - } catch (err) { - console.error('Error hashing password:', err); - next(err); - } + const salt = await bcrypt.genSalt(10); + this.password = await bcrypt.hash(this.password, salt); }); // Method to compare passwords From 1f115d6522ad8568a60052500a22a9f3c8d6114e Mon Sep 17 00:00:00 2001 From: TVATDCI Date: Thu, 12 Feb 2026 04:28:25 +0100 Subject: [PATCH 2/2] add trust proxy --- frontend/src/components/reg-auth/LoginForm.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/reg-auth/LoginForm.jsx b/frontend/src/components/reg-auth/LoginForm.jsx index 83cb580..ff80471 100644 --- a/frontend/src/components/reg-auth/LoginForm.jsx +++ b/frontend/src/components/reg-auth/LoginForm.jsx @@ -98,11 +98,13 @@ function LoginForm() { {loading ? 'Signing In...' : 'Sign In'} - - - +