Skip to content

Fix passkey sign-in intermittently doing nothing on desktop web#17

Open
jhurwitz wants to merge 1 commit into
phulin:mainfrom
jhurwitz:fix-passkey-already-pending
Open

Fix passkey sign-in intermittently doing nothing on desktop web#17
jhurwitz wants to merge 1 commit into
phulin:mainfrom
jhurwitz:fix-passkey-already-pending

Conversation

@jhurwitz
Copy link
Copy Markdown
Contributor

Summary

The conditional mediation (autofill) request started on LoginScreen mount was still in flight when the user clicked "Sign in with passkey", causing the browser to reject the explicit request and the passkey picker to never appear.

This is intermittent: it depends on whether the autofill's options fetch completes and registers navigator.credentials.get({mediation: "conditional"}) before the user clicks. When it loses the race, the browser throws "A request is already pending" — no picker appears, the button briefly shows "Signing in..." then reverts, and the error shows below.

Fix: store an AbortController for the autofill request and abort it at the top of handlePasskeyLogin, before starting the explicit request.

🤖 Generated with Claude Code

The conditional mediation (autofill) request started on LoginScreen mount
was still in flight when the user clicked "Sign in with passkey", causing
the browser to reject the second request and the passkey picker to never
appear. This is intermittent: it depends on whether the autofill's options
fetch completes and registers navigator.credentials.get({mediation:
"conditional"}) before the user clicks the button.

Fix by storing an AbortController for the autofill request and aborting it
before starting the explicit one.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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