diff --git a/src/components/AuthButton.tsx b/src/components/AuthButton.tsx index 146259f..e47c4f9 100644 --- a/src/components/AuthButton.tsx +++ b/src/components/AuthButton.tsx @@ -71,7 +71,9 @@ export function AuthButton() { try { await login(); } catch (e: any) { - if (e.name === 'NotAllowedError') { + // Any WebAuthn error (NotAllowedError, SecurityError, AbortError) + // should show register form — user likely has no passkey yet + if (e.name === 'NotAllowedError' || e.name === 'SecurityError' || e.name === 'AbortError') { setShowRegister(true); } else { setError(e.message || 'Sign in failed');