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:
@@ -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.";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
</svg>
|
||||
Continue with Passkey
|
||||
</button>
|
||||
<div data-webauthn-target="error" class="mt-2 text-sm text-red-600" style="display: none;"></div>
|
||||
</div>
|
||||
|
||||
<!-- Password section - shown by default, hidden if WebAuthn is required -->
|
||||
|
||||
Reference in New Issue
Block a user