<CreateOrganizationForm />
The <CreateOrganizationForm /> provides a professional, out-of-the-box interface for users to establish a new organization (sometimes called a Team, Tenant, or Account in B2B applications).
When a user successfully creates an organization via this component, Wacht executes a complex lifecycle event:
- It provisions the new organization record in the database.
- It assigns the creating user as the organization’s “Owner”, instantly granting them maximum RBAC privileges for that tenant.
- Crucially, it automatically performs a context switch—updating the user’s active session token so that their
activeOrganizationIdpoints to the newly minted organization.
Import
Usage
This component fits flawlessly into onboarding wizards, dedicated/organizations/new routes, or within modal dialogs in your application’s settings area.
Handling Completion
When a user successfully creates an organization, the component does not automatically redirect. Instead, you should utilize theonSuccess callback to route the user to their newly minted tenant dashboard.
