[GH-ISSUE #2542] Passkey Plugin does not work with throw: true #9244

Closed
opened 2026-04-13 04:39:49 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @hco on GitHub (May 5, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/2542

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  • Use Passkey Plugin
  • Configure your better-auth client with fetchOptions: { throw: true }
  • Call const result = authClient.passkey.addPasskey()

Current vs. Expected behavior

No passkey will be generated. If I understand everything correct, result will contain the register options.
My feeling is that this is related to b12b66cec6/packages/better-auth/src/plugins/passkey/client.ts (L112-L114) and maybe a similar problem exists in b12b66cec6/packages/better-auth/src/plugins/passkey/client.ts (L112-L114).

What version of Better Auth are you using?

1.2.7

Provide environment information

unrelated

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

Client

Auth config (if applicable)


Additional context

No response

Originally created by @hco on GitHub (May 5, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/2542 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce - Use Passkey Plugin - Configure your better-auth client with `fetchOptions: { throw: true }` - Call `const result = authClient.passkey.addPasskey()` ### Current vs. Expected behavior No passkey will be generated. If I understand everything correct, `result` will contain the register options. My feeling is that this is related to https://github.com/better-auth/better-auth/blob/b12b66cec66cde0ab74bbd105b98c60df25f96eb/packages/better-auth/src/plugins/passkey/client.ts#L112-L114 and maybe a similar problem exists in https://github.com/better-auth/better-auth/blob/b12b66cec66cde0ab74bbd105b98c60df25f96eb/packages/better-auth/src/plugins/passkey/client.ts#L112-L114. ### What version of Better Auth are you using? 1.2.7 ### Provide environment information ```bash unrelated ``` ### Which area(s) are affected? (Select all that apply) Client ### Auth config (if applicable) ```typescript ``` ### Additional context _No response_
GiteaMirror added the locked label 2026-04-13 04:39:49 -05:00
Author
Owner

@hco commented on GitHub (May 5, 2025):

Related: The fetchOptions are not being passed to the fetch requests for the first fetch that is being made in that methods - is that intended? 🤔

<!-- gh-comment-id:2850141165 --> @hco commented on GitHub (May 5, 2025): Related: The fetchOptions are not being passed to the fetch requests for the first fetch that is being made in that methods - is that intended? 🤔
Author
Owner

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

Hi, @hco. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that the Passkey Plugin in Better Auth v1.2.7 fails to generate a passkey when using fetchOptions: { throw: true }.
  • The problem seems related to error handling around lines 112-114 in the client code.
  • You observed that the initial fetch request does not include the configured fetchOptions, and you questioned if this behavior is intentional.
  • No maintainers have responded to this issue yet.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of better-auth by commenting here.
  • If I do not hear back within 7 days, this issue will be automatically closed.

Thank you for your understanding and contribution!

<!-- gh-comment-id:3151359120 --> @dosubot[bot] commented on GitHub (Aug 4, 2025): Hi, @hco. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that the Passkey Plugin in Better Auth v1.2.7 fails to generate a passkey when using `fetchOptions: { throw: true }`. - The problem seems related to error handling around lines 112-114 in the client code. - You observed that the initial fetch request does not include the configured `fetchOptions`, and you questioned if this behavior is intentional. - No maintainers have responded to this issue yet. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of better-auth by commenting here. - If I do not hear back within 7 days, this issue will be automatically closed. Thank you for your understanding and contribution!
Author
Owner

@hco commented on GitHub (Aug 4, 2025):

I am not sure if I can test this in the next 7 days.

<!-- gh-comment-id:3151384264 --> @hco commented on GitHub (Aug 4, 2025): I am not sure if I can test this in the next 7 days.
Author
Owner
<!-- gh-comment-id:3368005277 --> @ping-maxwell commented on GitHub (Oct 4, 2025): Related: https://github.com/better-auth/better-auth/pull/4984 Linear: https://linear.app/better-auth/issue/ENG-129/fix-passkey-client-returns-options-when-fetch-throws-with-throw-true
Author
Owner

@ping-maxwell commented on GitHub (Oct 4, 2025):

Additional context:

Image
<!-- gh-comment-id:3368006108 --> @ping-maxwell commented on GitHub (Oct 4, 2025): Additional context: <img width="994" height="1007" alt="Image" src="https://github.com/user-attachments/assets/8c914ee8-8145-4562-8d2f-a04982f06b65" />
Author
Owner

@ping-maxwell commented on GitHub (Oct 10, 2025):

It's now intentional that we do not support throw: true for passkey calls. Please explicitly remove them from passkey endpoints.

<!-- gh-comment-id:3390851792 --> @ping-maxwell commented on GitHub (Oct 10, 2025): It's now intentional that we do not support `throw: true` for passkey calls. Please explicitly remove them from passkey endpoints.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9244