Show user-friendly error when passkey authentication fails

Add error target to login page so WebAuthn errors are visible instead
of only appearing in the console. Use a helpful fallback message that
suggests a browser extension may be interfering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dan Milne
2026-03-05 23:11:43 +11:00
parent c5898bd9a4
commit f65df76d99
2 changed files with 3 additions and 2 deletions

View File

@@ -316,7 +316,7 @@ export default class extends Controller {
return "This authenticator has already been registered.";
}
// Fallback to error message
return error.message || "An unexpected error occurred";
// Fallback to a user-friendly message
return "Passkey authentication failed. A browser extension may be interfering — try using your password instead.";
}
}