Skip to content

fix(passkey): graceful skip on cancel / no-passkey#60

Merged
lakhansamani merged 4 commits into
mainfrom
feat/passkey-graceful-skip
Jul 12, 2026
Merged

fix(passkey): graceful skip on cancel / no-passkey#60
lakhansamani merged 4 commits into
mainfrom
feat/passkey-graceful-skip

Conversation

@lakhansamani

Copy link
Copy Markdown
Contributor

Makes the "Sign in with a passkey" button fail gracefully so a passkey-less user is never trapped or shown a scary error.

Problem

The passkey button renders whenever the browser supports WebAuthn — which includes users who have no passkey (there's no pre-auth way to know, by design). Clicking it then cancelling, or having no credential, both surface as NotAllowedError/AbortError, which the component showed as a red "Passkey login was cancelled or failed" banner.

Fix

Treat NotAllowedError / AbortError as a silent skip (user falls back to password/social/magic-link) instead of an error. Only genuine failures (network, verification) show a message. The browser deliberately doesn't distinguish "cancelled" from "no credential" to avoid leaking account state, so both are handled the same way.

Uses the SDK's existing error.code (already in the published types) — no dependency bump required, ships independently.

Verification

tsc --noEmit + tsup build pass.

Part of the passkey-login UX set alongside authorizer-js#43 (autofill SDK) and authorizer-react#59 (autofill wiring).

The "Sign in with a passkey" button is always shown when the browser supports
WebAuthn - including for users who have no passkey - so a cancel or an
account-with-no-passkey (both surface as NotAllowedError/AbortError) was
showing a red "cancelled or failed" error. Treat those as a silent skip so the
user just falls back to password/social login; only surface real failures.
@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size
dist/index.cjs 55.59 KB (+0.42% 🔺)
dist/index.mjs 55.17 KB (+0.42% 🔺)

@lakhansamani lakhansamani merged commit 066f404 into main Jul 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant