View and Select Active Organization on First Login
When a peer mentor successfully authenticates, the app must resolve their organization memberships and present a clear selection screen if they belong to more than one organization. Each organization is displayed as a card with its name, logo, and any relevant branding. Single-org users bypass this screen automatically and are routed directly into the app. The selection is persisted in a secure tenant session store so the user does not need to re-select on every login. This is critical for organizations like NHF where peer mentors can belong to up to 5 different local chapters.
User Story
Acceptance Criteria
- Given a peer mentor belongs to multiple organizations, when they complete authentication, then the org-selection-screen is displayed listing all their organizations as individual cards
- Given the org-selection-screen is displayed, when the peer mentor taps an organization card, then the tenant context is set, RLS policies are configured, and the peer mentor is routed to the home screen
- Given a peer mentor belongs to only one organization, when they complete authentication, then the org-selection-screen is skipped and the tenant context is automatically set
- Given the org-selection-screen is displayed, when the peer mentor views organization cards, then each card shows the organization name and any available branding (logo, accent color)
- Given organization selection is completed, when the peer mentor opens the app again within the same session, then the previously selected organization context is restored without showing the selection screen again
Business Value
Organization selection is the gateway to all downstream functionality. Without correct tenant isolation, peer mentors could see data from other organizations, violating GDPR and organizational trust boundaries. For NHF with 1,400 local chapters and multi-chapter membership, this feature directly enables the entire multi-tenant architecture. Skipping this for single-org users also reduces friction for the majority of users, supporting the design principle of lowest possible cognitive load.
Components
- Organization Selection Screen ui
- Organization Card Widget ui
- Organization Selection Service service
- Organization Persistence Repository data
- Organization Selection Screen ui
- Organization Card Widget ui
- Tenant Context Service service
- Organization Selection Service service
- Organization Route Guard service
- Multi-Organization Membership Resolver service
- Organization Repository data
- Tenant Session Store data
- Supabase RLS Tenant Scope Configurator infrastructure