Skip to content

Conversation

SiddharthSahai10
Copy link

Summary
This PR corrects the forgot password feature, which previously behaved like a change password flow. The updated implementation introduces an OTP verification step for better security and UX. OTPs are sent via email using Nodemailer, and the frontend UI has been updated to support the new flow.

What’s Changed

Backend

Fixed forgot password route logic to send OTP instead of directly updating password.

Integrated Nodemailer to send OTP emails to registered users.

Added OTP verification endpoint before allowing password reset.

Frontend

src/pages/ForgotPassword.jsx:

Updated UI to collect OTP after email submission.

Added API call to verify OTP before navigating to reset password form.

Shows status messages and handles error cases (invalid/expired/missing OTP).

src/utils/apiConfig.js: Added VERIFY_OTP endpoint.

How to Test

Navigate to /forgot-password.

Enter a registered email → click Send Code.

Check email for OTP (sent via Nodemailer).

Enter OTP in the app:

Correct OTP → navigates to /reset-password/:token.

Incorrect / expired / missing OTP → shows error message.

Set a new password → verify success.

Copy link

vercel bot commented Aug 12, 2025

@SiddharthSahai10 is attempting to deploy a commit to the coder-writes' projects Team on Vercel.

A member of the Team first needs to authorize it.

@coder-writes
Copy link
Owner

provide a demo demonstrating the changes on you machine and if video becomes too large and can't be uploaded here then uploaded it on drive and share the link

@SiddharthSahai10
Copy link
Author

SiddharthSahai10 commented Aug 13, 2025

@coder-writes
https://drive.google.com/file/d/1iR3Sp10528Uzqe3BO-qY0NCTHO1lHQAt/view?usp=sharing

this is the link of the live demo of the functionality i implemented

@SiddharthSahai10
Copy link
Author

@coder-writes
any improvisations sir?

@SiddharthSahai10
Copy link
Author

@coder-writes
I raised a PR for the "forgot password issue" a few days ago. It involved a lot of work, so I’d really appreciate it if you could review the demo u asked and atleast tell what needs to be done.

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.

2 participants