Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Resolve login failure issue due to password comparison #319

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

veepanshu-kasana
Copy link

Description

This pull request addresses the issue where users were unable to log in due to a password comparison failure in the handleUserLogin controller.

The issue was caused by the way the server was returning the data, which was not being handled correctly on the client-side. The updated handleLogin function now includes an additional check to ensure the plaintext password from the form matches the hashed password stored in the database using bcrypt.compare. This resolves the "Invalid credentials" error that users were experiencing during login.

Changes

  1. Updated the handleLogin function to use bcrypt.compare to directly compare the plaintext password from the form with the hashed password stored in the database.
  2. Improved error handling to display a more specific "Invalid credentials" error message to the user if the password comparison fails.
  3. Added additional logging and error handling to the catch block to help with debugging any future issues.

Fixes

Resolves #315 - Login failure due to password comparison issue

The issue was caused by the way the server was returning the data, which was not being handled correctly on the client-side. The updated `handleLogin` function now includes an additional check to ensure the plaintext password from the form matches the hashed password stored in the database using `bcrypt.compare`. This resolves the "Invalid credentials" error that users were experiencing during login.
Copy link

vercel bot commented Nov 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mmmut-mca ❌ Failed (Inspect) Nov 8, 2024 3:01pm

Copy link

netlify bot commented Nov 8, 2024

Deploy Preview for mmmutmcanetwork ready!

Name Link
🔨 Latest commit 686a1e3
🔍 Latest deploy log https://app.netlify.com/sites/mmmutmcanetwork/deploys/672e27a773879400088695cc
😎 Deploy Preview https://deploy-preview-319--mmmutmcanetwork.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Thank you for your contribution! Your pull request has been submitted successfully. A maintainer will review it as soon as possible. We appreciate your support in making this project better

Copy link

netlify bot commented Nov 8, 2024

Deploy Preview for mmmut-mca failed.

Name Link
🔨 Latest commit 686a1e3
🔍 Latest deploy log https://app.netlify.com/sites/mmmut-mca/deploys/672e27a7b2abe900089d5da1

@veepanshu-kasana
Copy link
Author

@abhishekraoas Why my pull request got failed bro!

@abhishekraoas
Copy link
Owner

@abhishekraoas Why my pull request got failed bro!

It's an issue during vercel deployment.

@abhishekraoas
Copy link
Owner

Description

This pull request addresses the issue where users were unable to log in due to a password comparison failure in the handleUserLogin controller.

The issue was caused by the way the server was returning the data, which was not being handled correctly on the client-side. The updated handleLogin function now includes an additional check to ensure the plaintext password from the form matches the hashed password stored in the database using bcrypt.compare. This resolves the "Invalid credentials" error that users were experiencing during login.

Changes

  1. Updated the handleLogin function to use bcrypt.compare to directly compare the plaintext password from the form with the hashed password stored in the database.
  2. Improved error handling to display a more specific "Invalid credentials" error message to the user if the password comparison fails.
  3. Added additional logging and error handling to the catch block to help with debugging any future issues.

Fixes

Resolves #315 - Login failure due to password comparison issue

Still not working. can you share the video of login steps

@veepanshu-kasana
Copy link
Author

@abhishekraoas Despite my attempts to resolve the issue, I have not been able to fully fix the problem yet. I apologize for not being able to resolve this, Thank you for your understanding.

@abhishekraoas
Copy link
Owner

@abhishekraoas Despite my attempts to resolve the issue, I have not been able to fully fix the problem yet. I apologize for not being able to resolve this, Thank you for your understanding.

Can you fix it or not ?

@veepanshu-kasana
Copy link
Author

veepanshu-kasana commented Nov 9, 2024

@abhishekraoas Despite my attempts to resolve the issue, I have not been able to fully fix the problem yet. I apologize for not being able to resolve this, Thank you for your understanding.

Can you fix it or not ?

I can't, apologise for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: FIx the Login Failure issue
2 participants