Skip to content

No Password Reset Functionality #245

Description

@devprashant19

Component: Node.js Backend / Authentication Flow
Files Affected: backend/controllers/authController.js, backend/routes/authRoutes.js

Description

The authentication system currently handles user registration, local login, and Google OAuth login. However, there is no implementation for a "Forgot Password" flow. If a user registers via email/password and forgets their credentials, there is no route to request a reset link and no mechanism to change the password, resulting in a permanent account lockout.

Proposed Fix

  1. Create a /forgot-password route that accepts an email, generates a time-limited reset JWT, stores it, and emails a reset link to the user (e.g., using nodemailer).
  2. Create a /reset-password route that validates the reset token and safely updates the password field in MongoDB using the existing bcrypt schema hooks.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions