Password Reset
The forgot-password flow in the mobile app, from requesting a code by email to setting a new password.
A signed-out user resets a forgotten password in four screens: enter email, enter the 4-digit code, choose a new password, success. Signed-in users change their password from the Security screen instead; see Profile and settings.
Where it lives
| Screen | Route | File | Who sees it |
|---|---|---|---|
| Password Reset (email) | /password-reset | app/(auth)/password-reset.tsx | Signed-out users |
| Confirm your Email (code) | /confirm-email | app/(auth)/confirm-email.tsx | Same; shared with sign-up |
| Password Reset (new password) | /new-password | app/(auth)/new-password.tsx | Same |
| Successful | /reset-success | app/(auth)/reset-success.tsx | Same |
API calls are the forgotPassword and resetPassword thunks in services/auth/auth-thunk.ts. Nothing is written to AsyncStorage during this flow.
Before you start
- The user must know the email address of the account.
- Network access, and access to that mailbox to read the code.
Flow
- On the sign-in screen the user taps "Forgot Password?". The app pushes
/password-reset. - The screen is titled "Password Reset" with the text "Enter your registered email address to get a code to recover your password." and one field, "Email Address".
- Tapping "Send code" with the field empty shows the alert "Error" / "Please enter your email address.". There is no format check in the app; the server requires a valid email.
- Otherwise the app fires
POST /api/v1/auth/forgot-passwordwithemail(lowercased, trimmed) andisMobile: true. The button shows a spinner while Reduxauth.loadingis true. - On success the alert "Success" shows the server message, or "Code sent successfully!" if there is none. The server always answers "If that email exists, a password reset code has been sent." so the alert does not reveal whether the account exists. The app then pushes
/confirm-emailwith theemailparam and nopurpose. - On failure the alert "Error" shows the server message or "Failed to send reset code. Please try again.".
- On "Confirm your Email" the user types the 4-digit code from the email. "Confirm" with fewer than four digits shows "Please enter the complete 4-digit code.".
- In this flow "Confirm" does not call the API. It pushes
/new-passwordwith paramsemailandcode. A wrong code is only discovered at step 12. - "Resend Code" becomes available after the 60 second countdown. It fires
POST /api/v1/auth/forgot-passwordagain with the same email, shows "Success" / "A new verification code has been sent to your email.", clears the boxes and restarts the timer. - The new-password screen is also titled "Password Reset". Fields:
| Field | Rule in the app |
|---|---|
| New Password | Required. At least 6 characters. |
| Confirm Password | Required. Must equal New Password. |
- "Continue" validates in this order and shows an "Error" alert for the first failure: "Please fill in all fields.", "Passwords do not match.", "Password must be at least 6 characters long.".
- The app fires
POST /api/v1/auth/reset-passwordwithtoken(the 4-digit code),passwordandemail. - On success the alert "Success" shows the server message or "Password reset successfully!", and the app pushes
/reset-success. - On failure (wrong or expired code, password too short for the server) the alert "Error" shows the server message or "Failed to reset password. Please try again.". The user stays on the new-password screen and has to go back one screen to enter a different code.
- The success screen animates a tick and shows "Successful" / "Password reset successful. You can now log in to your dashboard." with a "Log in" button.
The Log in button on the success screen does nothing
The "Log in" button in reset-success.tsx has no onPress handler, the screen has no back button, and the swipe-back gesture is disabled for this route. The user has no on-screen way to leave except closing the app (on Android the hardware back button should still return to the new-password screen). The password has already been changed at this point.
Password length rules disagree
The app requires 6 characters for the new password but the API requires 8 to 128. A 6 or 7 character password passes the app check and then fails with the server's validation message.
States and edge cases
- Code lifetime. The backend stores the reset code with a 15 minute expiry. An expired code fails at step 12, not at code entry.
- Unknown email. The flow looks identical: the success alert appears and the code screen opens, but no email arrives.
- Leftover copy. The new-password subtitle reads "Create a new password to be able to access your Taska dashboard." "Taska" is not this product's name; the string was carried over from a template.
- Eye icons. On the new-password screen the show or hide icons are inverted compared with the sign-in screen (the open eye is shown while the password is hidden).
- Remembered Password? Log in. The link under "Send code" pushes
/signinon top of the stack instead of going back. - Offline. Each step shows "Could not reach the server. Check your connection and try again." in its "Error" alert.
What happens next
- The backend clears the reset code once the password is changed.
- The user signs in with the new password on the sign-in screen. See Sign up and sign in.
- Existing sessions on other devices are not signed out by the app; whether the backend invalidates them is not visible from the mobile code.
HomeLink Hub