Org plugin - autoCreateOrganizationOnSignUp seems to not be implemented #1816

Closed
opened 2026-03-13 09:05:23 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @JoeRoddy on GitHub (Aug 31, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. enable org plugin
  2. enable property:
plugins: [
    organization({
      autoCreateOrganizationOnSignUp: true,
  })
]
  1. create user
  2. see no org is created

Current vs. Expected behavior

Org is expected to be created, nothing happens

What version of Better Auth are you using?

^1.3.7

System info

System:
    OS: macOS 15.6.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 119.33 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 139.0.7258.155
    Safari: 18.6

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

Types

Auth config (if applicable)

export const auth = betterAuth({
  database: prismaAdapter(db, { provider: 'postgresql' }),
  emailAndPassword: { enabled: true },
  plugins: [
    organization({
      autoCreateOrganizationOnSignUp: true,
    }),
    nextCookies(), // keep last
  ],
  telemetry: { enabled: false },
  advanced: { database: { generateId: false } },
});

Additional context

Image

code shows up in types, and nowhere else:

Image
Originally created by @JoeRoddy on GitHub (Aug 31, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. enable org plugin 2. enable property: ```ts plugins: [ organization({ autoCreateOrganizationOnSignUp: true, }) ] ``` 3. create user 4. see no org is created ### Current vs. Expected behavior Org is expected to be created, nothing happens ### What version of Better Auth are you using? ^1.3.7 ### System info ```bash System: OS: macOS 15.6.1 CPU: (8) arm64 Apple M1 Pro Memory: 119.33 MB / 16.00 GB Shell: 5.9 - /bin/zsh Browsers: Chrome: 139.0.7258.155 Safari: 18.6 ``` ### Which area(s) are affected? (Select all that apply) Types ### Auth config (if applicable) ```typescript export const auth = betterAuth({ database: prismaAdapter(db, { provider: 'postgresql' }), emailAndPassword: { enabled: true }, plugins: [ organization({ autoCreateOrganizationOnSignUp: true, }), nextCookies(), // keep last ], telemetry: { enabled: false }, advanced: { database: { generateId: false } }, }); ``` ### Additional context <img width="844" height="342" alt="Image" src="https://github.com/user-attachments/assets/ea95e5f0-db22-487c-a3f0-a74d2d925855" /> code shows up in types, and nowhere else: <img width="970" height="369" alt="Image" src="https://github.com/user-attachments/assets/253354a3-5466-44ab-9adc-d6c4888d8832" />
GiteaMirror added the plugin label 2026-03-13 09:05:23 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 31, 2025):

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

You're correct—autoCreateOrganizationOnSignUp is only present in the type definitions and is not implemented in the organization plugin or user creation logic, so enabling it has no effect in Better Auth v1.3.7 or the latest codebase [source].

Recent updates added organization lifecycle hooks (like beforeCreateOrganization and afterCreateOrganization), which you can use to run custom logic when organizations are created [source]. However, there is no built-in way to automatically create an organization when a user signs up.

If you want to auto-create an organization on sign-up, you'll need to implement this manually—typically by hooking into your user creation flow and calling client.organization.create after a new user is registered. You can also use the new organization hooks to customize organization creation, but triggering it automatically on sign-up will require custom code.

Let me know if you want a sample implementation or guidance on how to wire this up!

To reply, just mention @dosu.


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

@dosubot[bot] commented on GitHub (Aug 31, 2025): <!-- Greeting --> Hi @JoeRoddy! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> You're correct—`autoCreateOrganizationOnSignUp` is only present in the type definitions and is not implemented in the organization plugin or user creation logic, so enabling it has no effect in Better Auth v1.3.7 or the latest codebase [[source](https://github.com/better-auth/better-auth/pull/3624)]. Recent updates added organization lifecycle hooks (like `beforeCreateOrganization` and `afterCreateOrganization`), which you can use to run custom logic when organizations are created [[source](https://github.com/better-auth/better-auth/pull/4049)]. However, there is no built-in way to automatically create an organization when a user signs up. If you want to auto-create an organization on sign-up, you'll need to implement this manually—typically by hooking into your user creation flow and calling `client.organization.create` after a new user is registered. You can also use the new organization hooks to customize organization creation, but triggering it automatically on sign-up will require custom code. Let me know if you want a sample implementation or guidance on how to wire this up! <!-- 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/3ffa4508-f46b-40d9-9070-01e4cd63d4f8?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/3ffa4508-f46b-40d9-9070-01e4cd63d4f8?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/3ffa4508-f46b-40d9-9070-01e4cd63d4f8?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/3ffa4508-f46b-40d9-9070-01e4cd63d4f8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/3ffa4508-f46b-40d9-9070-01e4cd63d4f8?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/3ffa4508-f46b-40d9-9070-01e4cd63d4f8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/3ffa4508-f46b-40d9-9070-01e4cd63d4f8?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&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/4334)
Author
Owner

@ronnyandre commented on GitHub (Sep 19, 2025):

@dosu Can you show a sample implementation of this?

@ronnyandre commented on GitHub (Sep 19, 2025): @dosu Can you show a sample implementation of this?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1816