-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels
