Repository navigation
Preserve native Better Auth request body formats - #1042
Merged
Merged
Conversation
jimhoyd
marked this pull request as ready for review
September 30, 2026 13:10
This was referenced Sep 30, 2026
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and change
The Better Auth mount rejected form-encoded sign-in and operator-enabled plugin formats before the upstream handler could accept them. Forward the original bytes and media type, leaving endpoint format admission to Better Auth.
Keep the universal byte/header bounds and the existing JSON structural and Unicode guard (also for structured-suffix JSON). Validate raw text/form UTF-8 and percent-encoded form bytes without interpreting fields or changing duplicate-field semantics. Update the auth contract and the extension helper guidance, which previously imposed JSON on every provider body.
Closes #1039. Follows #841; does not resume #837 or add a framework-specific core adapter.
Verification
npm run verify: passed, including lint/typechecks/docs, 1,325 core tests, every workspace suite, packed-addon audits/integration, both provider proofs, ecosystem integration and multiprocess tests (1,736 tests total, zero failures).Compatibility and security
No YAML fields, dependency changes, schema migrations or sandbox changes. The original path allowlist, upstream CSRF/origin checks, rate limits, storage-failure handling and credential projection remain in place. For unsupported formats the upstream error envelope is now preserved. Binary/multipart parsing belongs to the enabled upstream endpoint; this does not promise every Better Auth plugin is supported or apply JSON-specific structural guards to binary payloads. No external OAuth provider was contacted.