Skip to content

feat(auth): signup flow with org creation/joining (domain matching) #3225

@PierreBrisorgueil

Description

@PierreBrisorgueil

Description

Modify the signup flow to handle organization creation or joining based on config and email domain.

Details

When organizations enabled + domainMatching:

  1. User signs up with email
  2. Extract domain from email (e.g. @acme.com)
  3. Check if an organization exists with that domain
    • Yes → create membership (role: member) on that organization
    • No → require organization creation (name, slug) → membership (role: owner)

When organizations enabled + no domainMatching:

  1. User signs up
  2. Organization creation step required (name, slug)

When organizations disabled:

  1. User signs up
  2. Organization auto-created in background (invisible)
  3. Membership (role: owner) created silently

Response

Signup response includes the organization info and abilities so the frontend can adapt.

Acceptance criteria

  • Domain matching finds existing organizations
  • New organization created when no match
  • Silent organization creation when organizations disabled
  • Signup response includes organization + abilities
  • Integration tests for all 3 scenarios

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Nice to have — can waitphase: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