[PR #5792] fix(two-factor): avoid GET endpoints with body #14473

Closed
opened 2026-04-13 09:29:34 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/5792

State: closed
Merged: Yes


What is changing?
With the upcoming better-call@1.0.26, GET endpoints will no longer allow a body to be specified, and instead all requests will be rejected.

To avoid issues with the change in behavior, I am updating all core endpoints to avoid this scenario. Right now, it impacts:

  • GET /two-factor/view-backup-codes -> POST /two-factor/view-backup-codes

Summary by cubic

Switch the two-factor backup codes endpoint from GET to POST to comply with better-call@1.0.26, which rejects GET requests with bodies. Updated the server endpoint and docs; behavior remains the same.

  • Migration

    • Call POST /two-factor/view-backup-codes instead of GET.
    • Request body and server-only access stay the same.
  • Dependencies

    • Bump better-call to 1.0.26.

Written for commit 3c78eb05b3. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5792 **State:** closed **Merged:** Yes --- **What is changing?** With the upcoming `better-call@1.0.26`, GET endpoints will [no longer allow](https://github.com/Bekacru/better-call/pull/64) a body to be specified, and instead all requests will be rejected. To avoid issues with the change in behavior, I am updating all core endpoints to avoid this scenario. Right now, it impacts: - GET `/two-factor/view-backup-codes` -> POST `/two-factor/view-backup-codes` <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Switch the two-factor backup codes endpoint from GET to POST to comply with better-call@1.0.26, which rejects GET requests with bodies. Updated the server endpoint and docs; behavior remains the same. - **Migration** - Call POST /two-factor/view-backup-codes instead of GET. - Request body and server-only access stay the same. - **Dependencies** - Bump better-call to 1.0.26. <sup>Written for commit 3c78eb05b3f09875bfbb0f088462ff52e67e29ee. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 09:29:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#14473