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

Closed
opened 2026-04-17 22:42:04 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5792
Author: @jonathansamines
Created: 11/6/2025
Status: Merged
Merged: 11/6/2025
Merged by: @Bekacru

Base: canaryHead: chore/avoid-get-with-body


📝 Commits (3)

  • 671ea61 chore(better-auth): avoid GET endpoints with body
  • fc997a4 update v
  • 3c78eb0 Merge branch 'canary' into chore/avoid-get-with-body

📊 Changes

4 files changed (+15 additions, -16 deletions)

View changed files

📝 docs/content/docs/plugins/2fa.mdx (+1 -1)
📝 packages/better-auth/src/plugins/two-factor/backup-codes/index.ts (+2 -2)
📝 pnpm-lock.yaml (+11 -12)
📝 pnpm-workspace.yaml (+1 -1)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5792 **Author:** [@jonathansamines](https://github.com/jonathansamines) **Created:** 11/6/2025 **Status:** ✅ Merged **Merged:** 11/6/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `chore/avoid-get-with-body` --- ### 📝 Commits (3) - [`671ea61`](https://github.com/better-auth/better-auth/commit/671ea611330b004a0a915344411d4074096583af) chore(better-auth): avoid GET endpoints with body - [`fc997a4`](https://github.com/better-auth/better-auth/commit/fc997a4ca68ea3246494a12ff93885a5c7f0e84a) update v - [`3c78eb0`](https://github.com/better-auth/better-auth/commit/3c78eb05b3f09875bfbb0f088462ff52e67e29ee) Merge branch 'canary' into chore/avoid-get-with-body ### 📊 Changes **4 files changed** (+15 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/2fa.mdx` (+1 -1) 📝 `packages/better-auth/src/plugins/two-factor/backup-codes/index.ts` (+2 -2) 📝 `pnpm-lock.yaml` (+11 -12) 📝 `pnpm-workspace.yaml` (+1 -1) </details> ### 📄 Description **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. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-17 22:42:04 -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#31827