POST /api/auth/forgot-password
Initiates the password reset process by sending a password reset link to the user’s email. For security, the response does not reveal whether the email exists in the system.Request body
Email address of the account to reset
Response
Always returns true for security reasons
Generic success message that doesn’t reveal account existence
Status codes
200- Request processed (email sent if account exists)400- Email parameter missing or invalid500- Internal server error
The password reset token expires after 1 hour. Users must complete the reset process before expiration.
Examples
Success response (200)
Error response (400)
Implementation details
When a valid email is found:- A 32-character hexadecimal reset token is generated
- The token is stored in the user’s record with a 1-hour expiration
- A password reset email is sent containing the token
- Previous reset tokens for the user are invalidated
- The token is still saved to the database
- The error is logged server-side but not exposed to the client
- The success message is returned to maintain consistent behavior