[PR #3361] [CLOSED] fix(client): Fix logic around sending FormData #4782

Closed
opened 2026-03-13 11:59:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3361
Author: @ping-maxwell
Created: 7/13/2025
Status: Closed

Base: mainHead: fix/client/form-data-method


📝 Commits (10+)

📊 Changes

2 files changed (+50 additions, -27 deletions)

View changed files

📝 packages/better-auth/src/client/path-to-object.ts (+35 -23)
📝 packages/better-auth/src/client/proxy.ts (+15 -4)

📄 Description

This PR fixes the logic around endpoints which require/use FormData. Primarily needed for the file-storage pluign in the future where something like SignUPEmail would require a FormData. (Since we can't send Blob/File via JSON we must use FormData)


Summary by cubic

When FormData is passed to an authClient API method, the request now uses POST by default instead of GET. This ensures endpoints expecting FormData receive the correct HTTP method.


🔄 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/3361 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 7/13/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/client/form-data-method` --- ### 📝 Commits (10+) - [`d82e8ad`](https://github.com/better-auth/better-auth/commit/d82e8adb6f56cfed9a24e6f765581699173d0b42) fix(client): If FormData is passed in args then use POST - [`53ff3d5`](https://github.com/better-auth/better-auth/commit/53ff3d5c657d935dd136df903a462a305bdd4ba2) Update packages/better-auth/src/client/proxy.ts - [`79a12e7`](https://github.com/better-auth/better-auth/commit/79a12e7fecd31376c55c0c8abc0d9bc256ee60d6) fix: body should send formData not destructured too - [`3849936`](https://github.com/better-auth/better-auth/commit/38499363c5d1780e9dd9316c1b464036c252f6af) fix: typeo - [`d5d0f3a`](https://github.com/better-auth/better-auth/commit/d5d0f3a6f7c0f4eba14a8fd7f21ac7c2244b60a3) fix: typo (again) - [`3b71714`](https://github.com/better-auth/better-auth/commit/3b71714a015ff659235b6bb0b6dde18d15c3d279) WIP: fix FormData type - [`04d7513`](https://github.com/better-auth/better-auth/commit/04d7513818cc9ba25700cab052911b0738fcfa31) wip: fix - [`6310914`](https://github.com/better-auth/better-auth/commit/6310914d5df4ba03df0d10500a935214859ec892) wip: test - [`7a78697`](https://github.com/better-auth/better-auth/commit/7a786978d460d93d9e23153039d1e6f418be7d52) WIP: fix - [`020134f`](https://github.com/better-auth/better-auth/commit/020134f1706ff399c13c7da8e6e7e85d9e05b362) wip ### 📊 Changes **2 files changed** (+50 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/client/path-to-object.ts` (+35 -23) 📝 `packages/better-auth/src/client/proxy.ts` (+15 -4) </details> ### 📄 Description This PR fixes the logic around endpoints which require/use FormData. Primarily needed for the file-storage pluign in the future where something like SignUPEmail would require a FormData. (Since we can't send Blob/File via JSON we must use FormData) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic When FormData is passed to an authClient API method, the request now uses POST by default instead of GET. This ensures endpoints expecting FormData receive the correct HTTP method. <!-- 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-03-13 11:59:38 -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#4782