[GH-ISSUE #3958] signIn.passkey promise never resolves in case of success #18408

Closed
opened 2026-04-15 16:52:15 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Daniel-dev-s on GitHub (Aug 12, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/3958

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Ex:

  1. Create a backend and frontend on different servers
  2. Add passkey as a better-auth plugin
  3. On a login page add autocomplete input and try to call authClient.signIn.passKey with some logic after this promise
  4. In case of success auth promise never resolves

Current vs. Expected behavior

Following the steps from previous section, I expect this promise to be resolved, for user redirecting after successful auth.

What version of Better Auth are you using?

1.3.4

System info

System:
    OS: Windows 11 10.0.26100
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 10.72 GB / 31.69 GB
  Browsers:
    Edge: Chromium (139.0.3405.86)
    Internet Explorer: 11.0.26100.1882

Which area(s) are affected? (Select all that apply)

Client

Auth config (if applicable)


Additional context

No response

Originally created by @Daniel-dev-s on GitHub (Aug 12, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/3958 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce Ex: 1. Create a backend and frontend on different servers 2. Add passkey as a better-auth plugin 3. On a login page add autocomplete input and try to call `authClient.signIn.passKey` with some logic after this promise 4. In case of success auth promise never resolves ### Current vs. Expected behavior Following the steps from previous section, I expect this promise to be resolved, for user redirecting after successful auth. ### What version of Better Auth are you using? 1.3.4 ### System info ```bash System: OS: Windows 11 10.0.26100 CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz Memory: 10.72 GB / 31.69 GB Browsers: Edge: Chromium (139.0.3405.86) Internet Explorer: 11.0.26100.1882 ``` ### Which area(s) are affected? (Select all that apply) Client ### Auth config (if applicable) ```typescript ``` ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-15 16:52:15 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 12, 2025):

Hi @Daniel-dev-s! I'm Dosu and I’m helping the better-auth team.

This looks like an edge case with cross-origin passkey authentication. The promise from authClient.signIn.passkey is supposed to resolve with authentication data, but if the expected browser event (like a postMessage or redirect completion) isn't received—often due to frontend/backend separation—the promise can hang indefinitely. The current implementation doesn't include a timeout or fallback for these cases, so you might want to add your own timeout logic around the promise as a workaround. Also, double-check your frontend/backend config: make sure your frontend domain is in trustedOrigins and use absolute URLs for callback redirects to avoid lost events in cross-origin flows. More details on conditional UI and browser requirements are in the passkey plugin docs.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

<!-- gh-comment-id:3180907258 --> @dosubot[bot] commented on GitHub (Aug 12, 2025): <!-- Greeting --> Hi @Daniel-dev-s! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> This looks like an edge case with cross-origin passkey authentication. The promise from `authClient.signIn.passkey` is supposed to resolve with authentication data, but if the expected browser event (like a postMessage or redirect completion) isn't received—often due to frontend/backend separation—the promise can hang indefinitely. The current implementation doesn't include a timeout or fallback for these cases, so you might want to add your own timeout logic around the promise as a workaround. Also, double-check your frontend/backend config: make sure your frontend domain is in `trustedOrigins` and use absolute URLs for callback redirects to avoid lost events in cross-origin flows. More details on conditional UI and browser requirements are in the [passkey plugin docs](https://better-auth.com/docs/plugins/passkey). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/e4d9a949-4a14-4a58-ba86-d35b6a14711f?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/e4d9a949-4a14-4a58-ba86-d35b6a14711f?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/e4d9a949-4a14-4a58-ba86-d35b6a14711f?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/e4d9a949-4a14-4a58-ba86-d35b6a14711f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e4d9a949-4a14-4a58-ba86-d35b6a14711f?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/e4d9a949-4a14-4a58-ba86-d35b6a14711f?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e4d9a949-4a14-4a58-ba86-d35b6a14711f?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/3958)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#18408