Skip to content

Conversation

@kylecarbs
Copy link
Member

Summary

When running in self-hosted mode, this PR implements automatic organization membership for new users:

  • First user signup: Creates a 'default' team organization and makes the user an owner
  • Subsequent users: Automatically added as members to all existing team organizations

This simplifies user management for self-hosted deployments where all users should have access to shared team organizations by default.

Changes

File Change
internal/api/src/server.ts Added autoJoinOrganizations?: boolean binding
internal/database/src/querier.ts Updated insertUser() with auto-join logic
internal/api/src/routes/auth/auth.server.ts Pass flag in OAuth and credentials signup
packages/server/src/server.ts Enable autoJoinOrganizations: true for self-hosted

Behavior

Scenario Result
First user signs up Personal org + 'default' team org (user is owner)
Subsequent users Personal org + member of all existing team orgs
New team org created later Only future signups join it

Testing

  • All modified packages typecheck successfully
  • Build passes

@vercel
Copy link

vercel bot commented Jan 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
blink Ready Ready Preview, Comment Jan 13, 2026 4:00pm

When running in self-hosted mode with autoJoinOrganizations enabled:
- First user signup creates a 'default' team organization (user becomes owner)
- Subsequent users are automatically added as members to all existing team orgs

The logic is inlined in auth handlers using existing querier methods.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant