Prompt
How do I add passkeys to my web app without breaking existing logins?
Latest observation
A good way to add passkeys without breaking existing logins is to treat them as an additional authentication method, not a replacement at first.
Recommended rollout plan
1) Keep your current login flow intact
Don’t change password, magic link, OAuth, or 2FA flows initially. Add passkeys alongside them so existing users can keep signing in normally.
2) Add passkeys as an account-level credential
Let users register one or more passkeys from their account/security settings after they’re already signed in.
Typical flow:
- User signs in with current method
- Goes to Security
- Clicks Add passkey
- Your backend creates a WebAuthn registration challenge
- Browser creates a credential with
navigator.credentials.create() - Backend verifies the response and stores the public key + metadata
3) Support passkey login as an option on the sign-in page
On your login screen, offer:
- Continue with password
- Continue with passkey
- Continue with email link / SSO / etc.
When user chooses passkey:
- Backend creates an authentication challenge
- Browser calls
navigator.credentials.get() - Backend verifies the assertion
- If valid, sign them in
4) Make passkeys optional, then gradually encourage them
To avoid account lockouts:
- Don’t require passkeys for everyone immediately
- Let users enroll multiple authenticators
- Offer backup methods during rollout
- Add prompts like “Use a passkey for faster sign-in”
5) Handle fallback and recovery
This is the part that prevents breaking logins.
Have a recovery path for users who:
- lose their device
- delete their passkey
- use an unsupported browser/device
Common fallback options:
- existing password
- email magic link
- backup codes
- support-assisted recovery
- OAuth/SSO if already linked
Implementation checklist
Backend
You’ll need endpoints for:
POST /webauthn/register/optionsPOST /webauthn/register/verifyPOST /webauthn/authenticate/optionsPOST /webauthn/authenticate/verify
Store:
- user ID
- credential ID
- public key
- sign count / counter
- transports if available
- a label / nickname for the passkey
- created/last-used timestamps
Frontend
Use the WebAuthn API:
navigator.credentials.create()for registrationnavigator.credentials.get()for login
Use publicKey options from your backend and send the result back for verification.
Security rules
- Always verify challenges server-side
- Bind challenges to the session/user and expire them quickly
- Use HTTPS only
- Set correct RP ID and origin
- Prefer resident/passkey-friendly options where appropriate
- Keep audit logs for enrollment and removal
UX tips to avoid breaking logins
- Let users add passkeys only after authenticating with an existing method
- Show which login methods are available on each account
- If a passkey login fails, immediately offer fallback methods
- Allow users to manage and delete old passkeys
- Warn users before removing their last remaining sign-in method
Best practice migration strategy
A safe sequence is:
- Ship passkey registration
- Ship passkey sign-in as an optional path
- Encourage enrollment with prompts
- Monitor support/recovery cases
- Eventually make passkeys the default, but keep fallback methods
If you want, I can also give you:
- a step-by-step WebAuthn backend design
- a frontend example in React/Next.js
- or a database schema for passkey storage