Prompt
How do I handle account recovery in a passwordless app?
Latest observation
In a passwordless app, account recovery is mostly about recovering the identity or the device, not “resetting a password.” The safest approach is to design multiple recovery paths that are strong enough to prevent account takeover, but still usable when someone loses access.
Common recovery options
1) Backup/recovery codes
- Generate a set of one-time codes when the account is created.
- Show them once and encourage the user to store them securely.
- Each code can be used to recover the account or add a new login method.
Pros: Simple, offline, works well.
Cons: Users can lose them or store them insecurely.
2) Trusted secondary factor
Examples:
- A second verified email
- A phone number for SMS/voice OTP
- A backup authenticator/passkey/device
Pros: Familiar and usable.
Cons: Email/phone can be weaker; SMS is vulnerable to SIM swap.
3) Passkeys on multiple devices
If your app uses passkeys:
- Let users register multiple passkeys/devices.
- Encourage adding a second device during onboarding.
Pros: Strong security, good UX.
Cons: If the only device is lost, recovery is harder.
4) Identity verification / support-assisted recovery
For high-risk or high-value accounts:
- User submits recovery request.
- Verify via email/phone/device signals.
- For stronger assurance, use document verification or manual review.
Pros: Works when everything else is lost.
Cons: Expensive, slower, and can be abused if weakly implemented.
5) Recovery links sent to verified contact methods
- Send a time-limited, single-use recovery link to a previously verified email/phone.
- Require additional checks before allowing critical changes.
Pros: Easy UX.
Cons: Security depends on the recovery channel.
Good recovery design principles
Minimize account takeover risk
Recovery is a common attack target. Protect it with:
- Short-lived, single-use recovery tokens
- Rate limiting and anti-enumeration controls
- Step-up verification for sensitive actions
- Notifications to existing contact methods when recovery is initiated
Avoid “knowledge-based” recovery questions
Security questions are usually weak:
- Easy to guess or research
- Often forgotten by users
- Poor against targeted attacks
Separate recovery from login
Treat recovery as a special flow:
- User proves access to a recovery method.
- User re-establishes login access.
- Existing sessions are reviewed or revoked as needed.
Make it clear to users during onboarding
If users don’t set up recovery up front, they can get locked out. Good onboarding should prompt them to:
- Add a second passkey/device
- Save recovery codes
- Verify email/phone
- Choose a trusted recovery method
A practical recovery flow
A solid default pattern:
- Primary login: passkey / magic link / device auth
- If lost access: user starts recovery
- Verify using a recovery method: backup code, verified email, second device, etc.
- Cooldown or step-up checks before changing critical settings
- Re-enroll login methods
- Notify user and revoke old sessions
For higher-risk accounts, add:
- A waiting period before finalizing recovery
- Additional verification if recovery method was recently changed
- Alerts for all prior devices and contact channels
Recommended approach by app type
Consumer app
- Passkeys or magic links
- Backup codes
- Verified email as recovery channel
- Optional phone verification
Financial / enterprise / sensitive data
- Passkeys plus backup codes
- Multiple verified devices
- Strong recovery via support/manual review
- Session revocation and alerting
- Avoid SMS-only recovery
Team/workspace apps
- Admin-assisted recovery
- Organization-managed recovery policies
- Device and identity checks
- Audit logs for recovery events
Don’t forget these edge cases
- User loses all devices
- Email account is compromised
- Phone number is recycled or ported
- Recovery codes are lost
- User is traveling or offline
- An attacker is attempting social engineering
Bottom line
The best passwordless recovery strategy is usually:
- Primary auth: passkeys or magic links
- Backup: recovery codes and/or secondary verified device
- Fallback: support-assisted recovery for worst cases
- Protection: strong rate limits, notifications, and session revocation
If you want, I can sketch a recommended recovery flow diagram or a concrete implementation pattern for passkeys + recovery codes.