New: Cookbooks and AI ExplanationsStep-by-Step recipes to solve problems connected to Roadmaps and Cheat Sheets. Need more details? Use AI buttons for structured and simple explanations with concrete examples throughout the whole platform.Take a look
Every navigator.credentials call that fails throws the same kind of error, and my catch block just shows one generic 'something went wrong' no matter what actually happened.
What you'll have at the end
One error-handling function that turns each WebAuthn failure into a specific message, tested against a cancelled prompt and an already-registered device.
You need
A sign-in and signup screen in a TypeScript codebase that already calls the browser's passkey registration and sign-in methods, each wrapped in a catch block that currently shows one generic message no matter what the browser actually reports.
Not covered
Building the registration and sign-in calls themselves, or deciding when to show a passkey option in the first place.
Rehearse a passkey flow in Chrome's DevTools
go there first for the full walkthrough of setting up a virtual authenticator, if you haven't configured one before reaching the verification steps here.
A passkey login that worked on localhost and broke right after deploy
go there if the classifier keeps logging the domain-setup bug after a deploy, since that's almost always a mismatched relying party ID, not a bug in this function.
Make sure a stuck passkey sign-in always has a real way out for users
go there to build the actual password fallback this recipe's retry message only ever points toward.
Checked 22 Aug 2026
Part of the Web Authentication and Passkeys cookbook