[PR #7699] [MERGED] feat(phone-number): support user additionalFields in signUpOnVerification flow #24400

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

📋 Pull Request Information

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

Base: canaryHead: 2026-01-30/feat/phone-number-additional-field


📝 Commits (3)

  • c10f0e7 chore: should keep singleton of ctx (#7654)
  • 5f9d613 feat(phone-number): support additionalFields in signUpOnVerification
  • 86fd589 fix: lint

📊 Changes

3 files changed (+121 additions, -36 deletions)

View changed files

📝 docs/content/docs/plugins/phone-number.mdx (+10 -0)
📝 packages/better-auth/src/plugins/phone-number/phone-number.test.ts (+59 -0)
📝 packages/better-auth/src/plugins/phone-number/routes.ts (+52 -36)

📄 Description

Note

Unlike the core APIs, the auth instance option types are not passed to plugin endpoints, which is a current limitation.

While it would be ideal to address this first, we could still introduce this feature since an error will occur when additionalField is required.

There are type-level limitations, but adding this feature could still be reasonable.

Related to https://github.com/better-auth/better-auth/issues/7694#issuecomment-3821696993


Summary by cubic

Enable passing user.additionalFields in the phone number verify endpoint when signUpOnVerification is enabled, so new users can be created with required custom fields. Adds input parsing and docs/tests; no migration needed.

  • New Features
    • Verify request now accepts additional fields and persists them on user creation (validated via parseUserInput).
    • Body schema extended to allow extra keys; known keys are stripped before createUser.
    • Docs updated with a client example; tests added for signUpOnVerification with required fields.
    • Note: type inference for additionalFields in plugin responses remains limited, but required fields are enforced at runtime.

Written for commit 86fd589874. 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/7699 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 1/30/2026 **Status:** ✅ Merged **Merged:** 1/30/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `2026-01-30/feat/phone-number-additional-field` --- ### 📝 Commits (3) - [`c10f0e7`](https://github.com/better-auth/better-auth/commit/c10f0e702760394ead4168a42674595f037614fc) chore: should keep singleton of ctx (#7654) - [`5f9d613`](https://github.com/better-auth/better-auth/commit/5f9d61372d155ab79e7f1b32986981309c3b5fb3) feat(phone-number): support additionalFields in signUpOnVerification - [`86fd589`](https://github.com/better-auth/better-auth/commit/86fd589874feed678847df450fe20f1503566071) fix: lint ### 📊 Changes **3 files changed** (+121 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/phone-number.mdx` (+10 -0) 📝 `packages/better-auth/src/plugins/phone-number/phone-number.test.ts` (+59 -0) 📝 `packages/better-auth/src/plugins/phone-number/routes.ts` (+52 -36) </details> ### 📄 Description > [!NOTE] > Unlike the core APIs, the auth instance option types are not passed to plugin endpoints, which is a current limitation. > > While it would be ideal to address this first, we could still introduce this feature since an error will occur when additionalField is required. > > There are type-level limitations, but adding this feature could still be reasonable. Related to https://github.com/better-auth/better-auth/issues/7694#issuecomment-3821696993 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Enable passing user.additionalFields in the phone number verify endpoint when signUpOnVerification is enabled, so new users can be created with required custom fields. Adds input parsing and docs/tests; no migration needed. - New Features - Verify request now accepts additional fields and persists them on user creation (validated via parseUserInput). - Body schema extended to allow extra keys; known keys are stripped before createUser. - Docs updated with a client example; tests added for signUpOnVerification with required fields. - Note: type inference for additionalFields in plugin responses remains limited, but required fields are enforced at runtime. <sup>Written for commit 86fd589874feed678847df450fe20f1503566071. 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-15 22:21:14 -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#24400