How it works
1 · App
User taps "Forgot password?" and enters an email
2 · App
Same confirmation for every email: "If an account exists, we sent a link"
3 · Email
Link with a long random token, valid once and for a short time
4 · App
Link opens the reset screen, user sets a new password (same rules as sign up)
5 · Server
Password saved, token burned, other sessions signed out, "password changed" email sent
Life of a reset token
becomes invalid forever when it is…
- Used · Password was changed with it
- Expired · Older than the limit (e.g. 30 min)
- Replaced · A newer link was requested (if the spec says so)
- The user asks for a reset. They tap Forgot password? and enter their email (sometimes a phone number).
- The app shows the same confirmation for everyone. Something like “If an account exists for this email, we’ve sent a link.” It must not say whether the email is registered. Otherwise the reset form becomes a tool for account enumerationAccount enumerationFinding out which emails are registered from differences in error messages or responses.Open in glossary →.
- The server creates a token and emails a link. This reset token is a one-time key, separate from the session token you get at login: a long random string, stored on the server with an expiry time (often 15 to 60 minutes) and a note of whether it was already used. The link looks like
https://app.example.com/reset?t=8f2a…. - The user opens the link. On a phone, a deep linkDeep linkA link that opens a specific screen inside an app instead of just its home screen.Open in glossary → should open the app’s reset screen. If the app isn’t installed, the website opens instead.
- The user sets a new password. The same rules as at sign up apply (for example “at least 8 characters”). Some products also refuse the current password, or recently used ones.
- The server finishes the job. It saves the new password (as a hash, see password hashingPassword hashingStoring a one-way scrambled version of a password instead of the password itself.Open in glossary →), marks the token as used, signs out other sessions if the spec says so, and sends a “Your password was changed” email so the real owner notices if it wasn’t them.
Several links: which one works?
Users impatiently tap Send reset link three times, then open the first email. What should happen? There are two common designs:
| Design | What happens | Why teams choose it |
|---|---|---|
| Only the latest link works | Requesting a new link cancels all older ones | Fewer valid keys to the account at the same time. A common choice. |
| All unexpired links work | Any link works until it is used or expires; using one cancels the rest | Friendlier when emails arrive out of order |
Neither is “the” right answer. What matters is that the behavior matches the spec (short for specification: the written requirements), and that a link never keeps working after a password was successfully changed. If the spec doesn’t say, ask. That question alone often uncovers a missing requirement.
Example requirements
Criterion 7 is rate limitingRate limitingCapping how many requests a user or device can make in a period of time.Open in glossary →: without it, anyone could flood a person’s inbox with reset emails, or hammer the server to test thousands of emails.
What a good reset email looks like
The email is part of the feature, so test it like a screen. Open it, read every word, and check where the link points.
Leaks and wrong environment
FreshCart
Your password
Hi {{first_name}},
You asked for your password. It is: Secret123! You can change it here:
Reset passwordhttp://test-env.freshcart.local/reset?email=anna@test.com
A broken name placeholder, the actual password in plain text (which also suggests the server stores it unhashed: a properly stored password can’t be read back, not even by the server), a link to a test environmentEnvironmentA setup of servers, data and configuration where the software runs, such as dev, staging or production.Open in glossary → over plain http (no encryption), and the email address in the URL.
Safe and clear
FreshCart
Reset your FreshCart password
Hi Anna,
Tap the button to choose a new password. The link expires in 30 minutes and works once.
Reset passwordhttps://freshcart.com/reset?t=8f2a…
Didn't ask for this? Ignore this email. Your password won't change.
Real name, a clear call to action, the expiry time, a random token in an https link to the productionProductionThe live environment that real users use.Open in glossary → domain (the live site real customers use), and a line for people who didn’t ask for it.
Check this part
Which confirmation message is safest after "Send reset link"?
You requested two reset links. The older one still works. Is it a bug?
The reset email says: "Your current password is Morning5k!". What does this tell you?