[GH-ISSUE #7277] Two Factor client plugin incorrectly sending GET requests instead of POST requests, causing 404 #28101

Closed
opened 2026-04-17 19:30:07 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @mhamid3d on GitHub (Jan 12, 2026).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/7277

To Reproduce

  1. Add twoFactorClient plugin to your application
  2. Call await authClient.twoFactor.getTotpUri({ password })
  3. Observe network tab and see that it incorrectly runs a GET request, which causes a 404 error

Current vs. Expected behavior

The getTotpUri endpoint is a POST endpoint, I'm guessing that because it's not explicitly defined in the pathMethods of the client plugin, it just defaults to GET which is incorrect.

What version of Better Auth are you using?

1.4.10

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

Client

Originally created by @mhamid3d on GitHub (Jan 12, 2026). Original GitHub issue: https://github.com/better-auth/better-auth/issues/7277 ### To Reproduce 1. Add `twoFactorClient` plugin to your application 2. Call `await authClient.twoFactor.getTotpUri({ password })` 3. Observe network tab and see that it incorrectly runs a GET request, which causes a 404 error ### Current vs. Expected behavior The `getTotpUri` endpoint is a `POST` endpoint, I'm guessing that because it's not explicitly defined in the `pathMethods` of the client plugin, it just defaults to `GET` which is incorrect. ### What version of Better Auth are you using? 1.4.10 ### Which area(s) are affected? (Select all that apply) Client
GiteaMirror added the lockedbug labels 2026-04-17 19:30:08 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Jan 12, 2026):

It seems that you're experiencing an issue where the getTotpUri method in the twoFactorClient plugin is sending a GET request instead of the expected POST request, resulting in a 404 error. This could be related to the fact that the endpoint is not explicitly defined in the pathMethods of the client plugin, which might cause it to default to a GET request.

To resolve this issue, you may want to check the twoFactorClient configuration or review the plugin's documentation to ensure that the endpoint methods are correctly defined. If the problem persists, please consider tagging @bekacru or @ping__ for further assistance from the Better Auth team.

What specific features or methods are you currently using in Better Auth that you would like more help with?

If you need more help, tag @better-auth-agent in a comment so I can respond.

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3736539333 --> @better-auth-agent[bot] commented on GitHub (Jan 12, 2026): It seems that you're experiencing an issue where the `getTotpUri` method in the `twoFactorClient` plugin is sending a `GET` request instead of the expected `POST` request, resulting in a 404 error. This could be related to the fact that the endpoint is not explicitly defined in the `pathMethods` of the client plugin, which might cause it to default to a `GET` request. To resolve this issue, you may want to check the `twoFactorClient` configuration or review the plugin's documentation to ensure that the endpoint methods are correctly defined. If the problem persists, please consider tagging @bekacru or @ping__ for further assistance from the Better Auth team. What specific features or methods are you currently using in Better Auth that you would like more help with? _If you need more help, tag @better-auth-agent in a comment so I can respond._ <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) • [Discord](https://discord.gg/fG2XXEuQX3) • [GitHub](https://github.com/Skyvern-AI/Skyvern) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/fG2XXEuQX3) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/Skyvern-AI/Skyvern)
Author
Owner

@mhamid3d commented on GitHub (Jan 12, 2026):

I confirmed that editing the pathMethods in client.ts is the reason why this is happening:

pathMethods: {
			"/two-factor/disable": "POST",
			"/two-factor/enable": "POST",
			"/two-factor/send-otp": "POST",
			"/two-factor/generate-backup-codes": "POST",
			"/two-factor/get-totp-uri": "POST",
			"/two-factor/verify-totp": "POST",
			"/two-factor/verify-otp": "POST",
			"/two-factor/verify-backup-code": "POST",
		},
<!-- gh-comment-id:3736542684 --> @mhamid3d commented on GitHub (Jan 12, 2026): I confirmed that editing the `pathMethods` in `client.ts` is the reason why this is happening: ```typescript pathMethods: { "/two-factor/disable": "POST", "/two-factor/enable": "POST", "/two-factor/send-otp": "POST", "/two-factor/generate-backup-codes": "POST", "/two-factor/get-totp-uri": "POST", "/two-factor/verify-totp": "POST", "/two-factor/verify-otp": "POST", "/two-factor/verify-backup-code": "POST", }, ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#28101