[PR #6744] [MERGED] fix: properly validate body on email signup #23760

Closed
opened 2026-04-15 21:57:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6744
Author: @jslno
Created: 12/14/2025
Status: Merged
Merged: 12/14/2025
Merged by: @Bekacru

Base: canaryHead: 12-14-2025/fix-email-signup-body-schema


📝 Commits (2)

  • bab7101 fix: properly validate body on email signup
  • 4ae32e7 Merge branch 'canary' into 12-14-2025/fix-email-signup-body-schema

📊 Changes

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

View changed files

📝 packages/better-auth/src/api/routes/sign-up.test.ts (+17 -0)
📝 packages/better-auth/src/api/routes/sign-up.ts (+10 -1)

📄 Description

closes #6743


Summary by cubic

Enforces strict body validation for email sign-up so invalid payloads return 400. Requires name, email, and password while still allowing optional and custom fields.

  • Bug Fixes
    • Replace permissive body schema with explicit z.object: name, email, password required; image, callbackURL, rememberMe optional; extra fields allowed.
    • Add test that asserts a 400 error when required fields are missing.

Written for commit 4ae32e7215. 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/6744 **Author:** [@jslno](https://github.com/jslno) **Created:** 12/14/2025 **Status:** ✅ Merged **Merged:** 12/14/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `12-14-2025/fix-email-signup-body-schema` --- ### 📝 Commits (2) - [`bab7101`](https://github.com/better-auth/better-auth/commit/bab71015eb1bcf039c0c5b3ebe2999aabe7475bd) fix: properly validate body on email signup - [`4ae32e7`](https://github.com/better-auth/better-auth/commit/4ae32e721541a1b50ccc89ff9db0b8dacfd317cb) Merge branch 'canary' into 12-14-2025/fix-email-signup-body-schema ### 📊 Changes **2 files changed** (+27 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/sign-up.test.ts` (+17 -0) 📝 `packages/better-auth/src/api/routes/sign-up.ts` (+10 -1) </details> ### 📄 Description closes #6743 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Enforces strict body validation for email sign-up so invalid payloads return 400. Requires name, email, and password while still allowing optional and custom fields. - **Bug Fixes** - Replace permissive body schema with explicit z.object: name, email, password required; image, callbackURL, rememberMe optional; extra fields allowed. - Add test that asserts a 400 error when required fields are missing. <sup>Written for commit 4ae32e721541a1b50ccc89ff9db0b8dacfd317cb. 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-15 21:57:39 -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#23760