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

BUG: FIx the Login Failure issue #315

Open
abhishekraoas opened this issue Nov 5, 2024 · 2 comments · May be fixed by #319
Open

BUG: FIx the Login Failure issue #315

abhishekraoas opened this issue Nov 5, 2024 · 2 comments · May be fixed by #319
Assignees

Comments

@abhishekraoas
Copy link
Owner

abhishekraoas commented Nov 5, 2024

Here's a sample GitHub issue template for the login failure:


Bug Report: Login Failure Due to Password Comparison Issue

Issue Description

Users are unable to log in due to a password comparison failure in the handleUserLogin controller. Despite entering the correct credentials, login attempts are rejected with an "Invalid credentials" error.

Steps to Reproduce

  1. Sign up a new user account with a password.
  2. Attempt to log in using the correct email and password.

Expected Behavior

The login should succeed if the correct email and password are provided.

Actual Behavior

The login fails, returning an "Invalid credentials" error, even when the correct password is entered.

Possible Causes

  • Manual re-hashing of the password before comparison may be causing the mismatch.
  • There might be an issue with how bcrypt compares the plaintext password with the hashed password.

Suggested Solution

  • Ensure bcrypt.compare is used directly for comparing the plaintext password from the request with the hashed password stored in the database.
  • Double-check that the password is properly hashed and saved during the signup process.

Code Snippet (if applicable)

// Handle Login
const isMatch = await bcrypt.compare(password, userExist.password);
if (isMatch) {
  // proceed with login
} else {
  // handle failed login
}


This issue template should provide the development team with all the context needed to address the login failure problem effectively.

@abhishekraoas abhishekraoas added the bug Something isn't working label Nov 6, 2024
@veepanshu-kasana
Copy link

@abhishekraoas I want to contribute to this project on this particular issue. Please assign it to me!

@abhishekraoas
Copy link
Owner Author

@veepanshu-kasana you can work on it

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

Successfully merging a pull request may close this issue.

2 participants