[PR #7617] [MERGED] feat: make name field optional #15690

Closed
opened 2026-04-13 10:10:32 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7617
Author: @bytaesu
Created: 1/26/2026
Status: Merged
Merged: 1/29/2026
Merged by: @himself65

Base: canaryHead: 2026-01-25/feat/name-field-nullish


📝 Commits (9)

  • a79b9bc feat: make name field optional
  • a36d4dc test: add missing kysely schema with uuid generator
  • 48e014e test: update cli snapshots
  • 989773d Merge branch 'canary' into 2026-01-25/feat/name-field-nullish
  • 1ddb2fb fix: use nullish
  • 23171f1 test: update e2e fixture
  • 5faf6a9 test: use toEqualTypeOf
  • 9420e38 fix: correct missing hardcoded type
  • 66f62c9 test: correct

📊 Changes

66 files changed (+199 additions, -155 deletions)

View changed files

📝 docs/content/docs/authentication/email-password.mdx (+4 -4)
📝 docs/content/docs/basic-usage.mdx (+1 -1)
📝 docs/content/docs/concepts/database.mdx (+12 -9)
📝 docs/content/docs/guides/next-auth-migration-guide.mdx (+1 -1)
📝 e2e/smoke/test/fixtures/tsconfig-declaration/src/username.ts (+1 -1)
📝 packages/better-auth/src/api/routes/callback.ts (+1 -1)
📝 packages/better-auth/src/api/routes/sign-in.ts (+1 -1)
📝 packages/better-auth/src/api/routes/sign-up.test.ts (+16 -0)
📝 packages/better-auth/src/api/routes/sign-up.ts (+4 -4)
📝 packages/better-auth/src/client/client.test.ts (+9 -9)
📝 packages/better-auth/src/client/path-to-object.ts (+1 -1)
📝 packages/better-auth/src/plugins/custom-session/custom-session.test.ts (+3 -2)
📝 packages/better-auth/src/plugins/email-otp/routes.ts (+0 -1)
📝 packages/better-auth/src/plugins/generic-oauth/routes.ts (+0 -4)
📝 packages/better-auth/src/plugins/magic-link/index.ts (+1 -1)
📝 packages/better-auth/src/plugins/mcp/index.ts (+3 -2)
📝 packages/better-auth/src/plugins/oidc-provider/index.ts (+6 -4)
📝 packages/better-auth/src/plugins/open-api/__snapshots__/open-api.test.ts.snap (+1 -3)
📝 packages/better-auth/src/plugins/organization/organization.test.ts (+5 -5)
📝 packages/better-auth/src/plugins/organization/schema.ts (+2 -2)

...and 46 more files

📄 Description

Note

This PR make the name field optional in the core user schema.

  • Email–password sign-ups are now allowed without a name.
  • Remove logic that masked missing names with empty strings or emails.
  • Since name is not used as an identifier, the impact on core logic is minimal.
  • This is a breaking change because name is no longer always returned.

Closes https://github.com/better-auth/better-auth/issues/424
Closes https://github.com/better-auth/better-auth/issues/5139


Summary by cubic

Make the user name optional across the platform. Sign-up no longer requires a name, and all APIs, types, docs, and integrations now handle null or missing names safely.

  • Refactors
    • User schema: name is now nullish; CLI generators and snapshots updated to make the column nullable.
    • API/OpenAPI: sign-up body accepts optional name; responses allow null; removed fallbacks to email/empty string.
    • Integrations: OAuth/social providers, Magic Link, Email OTP, OIDC/MCP, SCIM, and Stripe updated to work without a name.
    • Client types, tests, and docs updated (including OIDC claims parsing and SCIM name formatting).

Written for commit 66f62c9bda. Summary will update 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/7617 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 1/26/2026 **Status:** ✅ Merged **Merged:** 1/29/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `2026-01-25/feat/name-field-nullish` --- ### 📝 Commits (9) - [`a79b9bc`](https://github.com/better-auth/better-auth/commit/a79b9bcd180e9b25febb796415bb101c4a56fcaf) feat: make name field optional - [`a36d4dc`](https://github.com/better-auth/better-auth/commit/a36d4dc433e38527804aca8cf46408b3b4aa579a) test: add missing kysely schema with uuid generator - [`48e014e`](https://github.com/better-auth/better-auth/commit/48e014ea8c3625094cfd091262322e3bfa53680d) test: update cli snapshots - [`989773d`](https://github.com/better-auth/better-auth/commit/989773d3eddc5ac5d6e2fe9906f60d07c375f35c) Merge branch 'canary' into 2026-01-25/feat/name-field-nullish - [`1ddb2fb`](https://github.com/better-auth/better-auth/commit/1ddb2fbff14f35920cbec07a5f219b1cb1d7c683) fix: use nullish - [`23171f1`](https://github.com/better-auth/better-auth/commit/23171f1c3a1cc36ad4bd439bee492e95a978414d) test: update e2e fixture - [`5faf6a9`](https://github.com/better-auth/better-auth/commit/5faf6a99033d927ca15a59018e829029f469d453) test: use toEqualTypeOf - [`9420e38`](https://github.com/better-auth/better-auth/commit/9420e38fe1e172869d74261d5ebe22aa983f37d3) fix: correct missing hardcoded type - [`66f62c9`](https://github.com/better-auth/better-auth/commit/66f62c9bda0ec8bbc3280c2dc24f435d9a2de457) test: correct ### 📊 Changes **66 files changed** (+199 additions, -155 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/authentication/email-password.mdx` (+4 -4) 📝 `docs/content/docs/basic-usage.mdx` (+1 -1) 📝 `docs/content/docs/concepts/database.mdx` (+12 -9) 📝 `docs/content/docs/guides/next-auth-migration-guide.mdx` (+1 -1) 📝 `e2e/smoke/test/fixtures/tsconfig-declaration/src/username.ts` (+1 -1) 📝 `packages/better-auth/src/api/routes/callback.ts` (+1 -1) 📝 `packages/better-auth/src/api/routes/sign-in.ts` (+1 -1) 📝 `packages/better-auth/src/api/routes/sign-up.test.ts` (+16 -0) 📝 `packages/better-auth/src/api/routes/sign-up.ts` (+4 -4) 📝 `packages/better-auth/src/client/client.test.ts` (+9 -9) 📝 `packages/better-auth/src/client/path-to-object.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/custom-session/custom-session.test.ts` (+3 -2) 📝 `packages/better-auth/src/plugins/email-otp/routes.ts` (+0 -1) 📝 `packages/better-auth/src/plugins/generic-oauth/routes.ts` (+0 -4) 📝 `packages/better-auth/src/plugins/magic-link/index.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/mcp/index.ts` (+3 -2) 📝 `packages/better-auth/src/plugins/oidc-provider/index.ts` (+6 -4) 📝 `packages/better-auth/src/plugins/open-api/__snapshots__/open-api.test.ts.snap` (+1 -3) 📝 `packages/better-auth/src/plugins/organization/organization.test.ts` (+5 -5) 📝 `packages/better-auth/src/plugins/organization/schema.ts` (+2 -2) _...and 46 more files_ </details> ### 📄 Description > [!NOTE] > This PR make the `name` field optional in the core `user` schema. > > - Email–password sign-ups are now allowed without a name. > - Remove logic that masked missing names with empty strings or emails. > - Since name is not used as an identifier, the impact on core logic is minimal. > - This is a breaking change because name is no longer always returned. Closes https://github.com/better-auth/better-auth/issues/424 Closes https://github.com/better-auth/better-auth/issues/5139 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Make the user name optional across the platform. Sign-up no longer requires a name, and all APIs, types, docs, and integrations now handle null or missing names safely. - **Refactors** - User schema: name is now nullish; CLI generators and snapshots updated to make the column nullable. - API/OpenAPI: sign-up body accepts optional name; responses allow null; removed fallbacks to email/empty string. - Integrations: OAuth/social providers, Magic Link, Email OTP, OIDC/MCP, SCIM, and Stripe updated to work without a name. - Client types, tests, and docs updated (including OIDC claims parsing and SCIM name formatting). <sup>Written for commit 66f62c9bda0ec8bbc3280c2dc24f435d9a2de457. Summary will update 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-13 10:10:32 -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#15690