SeattleColleges / nsc-events-nextjs

NSC Events Web Application
MIT License
5 stars 5 forks source link

nsc-events-nextjs_9_539_add-confirmation-message-on-forgot-password-page #540

Closed alasali1 closed 1 month ago

alasali1 commented 2 months ago

In this pull request for issue #539 I created an error/success message that pops up when the user clicks the submit button on the forgot password page. image

I was able to validate the emails and check if they exist to display the success message if the email does exist, and an error message if it does not. image

MuhammadNSC commented 2 months ago

Error massage appears when user insert wrong email and then prompts you to enter a registered email.

Screenshot 2024-07-14 at 5 33 13 PM
alasali1 commented 2 months ago

I get an error message even though the email address is valid. image

I was able to get a success message by putting the email that is hardcoded in your changes. The problem with this is that we would not want any hardcoded emails. What we need is to check if the entered email address is in the database and then a success message would be given if it is (and an email is sent to that email address, but this is outside the scope of this PR). Otherwise, if the email address is not in the database, there should be an error message. I believe most of this logic is implemented in the backend, it's just a matter of calling the forgotPassword API endpoint in the frontend so the correct response is given. image

Thank you. I think I was able to make the fix. I just sent a POST request to auth/forgot-password and it seems to be working as intended now.

heosman commented 1 month ago

@alasali1 Loks like it's working now.

Successful:

image

Failure:

image