[GH-ISSUE #3336] User field isn't required to signup on Email and password signup but documentation states it is #26896

Closed
opened 2026-04-17 17:38:10 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @Kaleab41 on GitHub (Jul 10, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/3336

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

1.Create an auth using email and password
2.Send a request with name field skipped

Current vs. Expected behavior

According to the documentation required fields for a signup are email, password and name but only if email and password only are provided user is still created.

What version of Better Auth are you using?

1.2.12

Provide environment information

- OS : [ UBUNTU ]
- NODE : [22.15.1]

Which area(s) are affected? (Select all that apply)

Backend, Documentation

Auth config (if applicable)

export const auth = betterAuth({
  trustedOrigins: ['http://localhost:5173'],
  emailAndPassword: { enabled: true },
  database: prismaAdapter(prisma, { provider: 'mongodb' }),
});

Additional context

This is a sample request I send and the written value on the db and also attached the documentation section.
Image
Image
Image

Originally created by @Kaleab41 on GitHub (Jul 10, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/3336 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1.Create an auth using email and password 2.Send a request with name field skipped ### Current vs. Expected behavior According to the documentation required fields for a signup are email, password and name but only if email and password only are provided user is still created. ### What version of Better Auth are you using? 1.2.12 ### Provide environment information ```bash - OS : [ UBUNTU ] - NODE : [22.15.1] ``` ### Which area(s) are affected? (Select all that apply) Backend, Documentation ### Auth config (if applicable) ```typescript export const auth = betterAuth({ trustedOrigins: ['http://localhost:5173'], emailAndPassword: { enabled: true }, database: prismaAdapter(prisma, { provider: 'mongodb' }), }); ``` ### Additional context This is a sample request I send and the written value on the db and also attached the documentation section. <img width="494" height="739" alt="Image" src="https://github.com/user-attachments/assets/3660cb9a-4171-406b-8507-796c10ac6885" /> <img width="386" height="158" alt="Image" src="https://github.com/user-attachments/assets/4c7691c0-8a63-458a-93d5-be932046d742" /> <img width="797" height="531" alt="Image" src="https://github.com/user-attachments/assets/6102eb52-c67c-4ec3-b9ea-1d39b20b7d8d" />
GiteaMirror added the locked label 2026-04-17 17:38:10 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 10, 2025):

Hi @Kaleab41! I'm Dosu and I’m helping the better-auth team.

You're correct—there's a mismatch between the documentation and the actual behavior in version 1.2.12. The docs and several discussions state that the 'name' field is required for email/password signup and enforced at the API and schema level (discussion), but the codebase only requires 'email' and 'password' for signup. The validation schema and controller logic do not enforce 'name' as required, which matches what you're seeing in practice.

This is a valid issue affecting both the backend and documentation. It's not currently tracked in open issues, but it has been discussed in the community. The implementation and documentation should be made consistent—either by updating the docs or enforcing the 'name' field in the code.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

<!-- gh-comment-id:3058589713 --> @dosubot[bot] commented on GitHub (Jul 10, 2025): <!-- Greeting --> Hi @Kaleab41! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> You're correct—there's a mismatch between the documentation and the actual behavior in version 1.2.12. The docs and several discussions state that the 'name' field is required for email/password signup and enforced at the API and schema level ([discussion](https://github.com/better-auth/better-auth/discussions/3222)), but the codebase only requires 'email' and 'password' for signup. The validation schema and controller logic do not enforce 'name' as required, which matches what you're seeing in practice. This is a valid issue affecting both the backend and documentation. It's not currently tracked in open issues, but it has been discussed in the community. The implementation and documentation should be made consistent—either by updating the docs or enforcing the 'name' field in the code. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/f125a054-e545-4390-90f4-16c7ce8972a7?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/f125a054-e545-4390-90f4-16c7ce8972a7?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/f125a054-e545-4390-90f4-16c7ce8972a7?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/f125a054-e545-4390-90f4-16c7ce8972a7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/f125a054-e545-4390-90f4-16c7ce8972a7?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/f125a054-e545-4390-90f4-16c7ce8972a7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/f125a054-e545-4390-90f4-16c7ce8972a7?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/3336)
Author
Owner

@Qodestackr commented on GitHub (Jul 15, 2025):

It complains to me about username while using email, its so funny and terribly fails lol { username: [ "Username can't be blank" ] }

<!-- gh-comment-id:3073469409 --> @Qodestackr commented on GitHub (Jul 15, 2025): It complains to me about username while using email, its so funny and terribly fails lol `{ username: [ "Username can't be blank" ] }`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#26896