Skip to content

feat(organizations): config (enable/disable, autoCreate, domainMatching) #3224

@PierreBrisorgueil

Description

@PierreBrisorgueil

Description

Add organization configuration to support both B2B (organizations visible) and B2C (organizations hidden) modes.

Details

Config section:

organizations: {
  enabled: true,        // false → B2C mode, organizations invisible to users
  autoCreate: true,     // auto-create a default organization on signup
  domainMatching: true, // match users to existing organizations by email domain
}

When enabled: false:

  • Organization is auto-created at signup (invisible to user)
  • No organization switcher, no organization pages in frontend
  • User gets owner membership on their implicit organization
  • All CASL abilities still work (scoped to implicit organization)
  • Can switch to B2B later without refactoring

Config exposed via GET /api/auth/config response:

{
  "sign": { "in": true, "up": true },
  "organizations": { "enabled": true, "domainMatching": true }
}

Acceptance criteria

  • Config toggles organization visibility
  • B2C mode: organization auto-created silently at signup
  • B2B mode: organization creation/joining flow at signup
  • Config exposed in auth/config endpoint

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important — depends on P1phase:2-orgsPhase 2: Multi-tenancy & Organizations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions