Skip to content

Fix Issue Handling in Forget Password Function #1222

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

Open
Rk-2005 opened this issue Mar 1, 2025 · 3 comments · May be fixed by #1224
Open

Fix Issue Handling in Forget Password Function #1222

Rk-2005 opened this issue Mar 1, 2025 · 3 comments · May be fixed by #1224

Comments

@Rk-2005
Copy link

Rk-2005 commented Mar 1, 2025

Description:
Currently, when a user enters an unregistered email in the forget password functionality, the server responds with a 500 Internal Server Error instead of a proper 404 Not Found message stating that the email is not registered. This happens because the code attempts to access user._id before checking if user is null.

Steps to Reproduce:

Send a POST request to the forget password endpoint with an unregistered email.

Observe that the server returns a 500 Internal Server Error with a message Cannot read properties of null (reading '_id') instead of a proper 404 response.

Expected Behavior:

The server should return a 404 Not Found with a message: No account with this email has been registered.

Image
How i khow my email is in correct

@RahulNaval21
Copy link

RahulNaval21 commented Mar 2, 2025

"Hi, I'd love to contribute to this issue! Could you please confirm if it's still unassigned? If so, I’d be happy to work on it and submit a fix. Looking forward to your response!" @Rk-2005

@Rk-2005
Copy link
Author

Rk-2005 commented Mar 2, 2025

Hey [RahulNaval21], I have resolved the issue. You can check out issue #1221. It has not been assigned yet.

@RahulNaval21
Copy link

Thanks for the update.

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 a pull request may close this issue.

2 participants