Password reset is a two-step flow: the user requests a reset link by email, then submits a new password using the token from that link.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/eggarcia98/auth-backend/llms.txt
Use this file to discover all available pages before exploring further.
Flow overview
Request a reset link
The client posts the user’s email to
POST /api/v1/auth/forgot-password. Supabase sends a password-reset email with a link pointing to FRONTEND_URL/auth/reset-password?token=....User clicks the email link
The user opens the email and clicks the link. The browser opens the frontend reset-password page with an access token in the URL.
Frontend extracts the token
The frontend reads the
token query parameter from the URL and stores it temporarily in memory (not in localStorage).Step 1 — Request a reset link
Request
curl
Request body
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Email address of the account to reset |
Response
The API returns the same success response regardless of whether the email address is registered. This prevents account enumeration.
Step 2 — Submit the new password
Request
curl
Request body
| Field | Type | Required | Description |
|---|---|---|---|
token | string | Yes | Reset token from the email link (also required in Authorization header) |
password | string | Yes | New password — must meet all requirements below |
Authorization header
The reset token from the email link must be sent as a Bearer token:Response
Password requirements
New passwords are validated byresetPasswordSchema in src/schemas/auth.schemas.ts. All four rules must pass:
| Rule | Requirement |
|---|---|
| Minimum length | At least 8 characters |
| Uppercase letter | At least one A–Z character |
| Lowercase letter | At least one a–z character |
| Number | At least one 0–9 digit |
Frontend integration
TypeScript
Error cases
| Scenario | HTTP status | Error message |
|---|---|---|
| Missing or invalid email | 400 | Invalid email address |
| Password too short | 400 | Password must be at least 8 characters |
| Password missing uppercase | 400 | Password must contain at least one uppercase letter |
| Password missing lowercase | 400 | Password must contain at least one lowercase letter |
| Password missing number | 400 | Password must contain at least one number |
Missing Authorization header | 401 | Missing or invalid authorization header |
| Invalid or expired reset token | 400 | Supabase validation error message |