Supabase Auth Integration
Switchbord uses Supabase Auth as its authentication backbone. All user sessions are managed through Supabase’s JWT-based session system, with server-side validation on every API request.Authentication is enforced at the API route level. Every route begins with session validation before any business logic executes.
Session Management
Session Timeboxing
Sessions are subject to two independent expiry controls:
These limits are configured in Supabase and enforced server-side — extending them requires an admin configuration change, not a client workaround.
Session Revocation on Member Removal
When a workspace member is removed, their active sessions are immediately invalidated across all devices:'global' scope ensures that all sessions for the user are terminated — not just the current one. This prevents a removed member from continuing to use an existing session after losing workspace access.
Password Policy
Switchbord enforces the following password requirements, configured in Supabase:- Minimum 12 characters
- At least one uppercase letter
- At least one digit
- Enforced at signup and password change
Multi-Factor Authentication
Supabase TOTP (Time-based One-Time Password) MFA is available for all users. Users can enroll an authenticator app from their account settings.Role-Based Access Control
Switchbord implements four roles with distinct permission levels. Role assignment is managed by workspace owners and admins.Role Hierarchy
Role Enforcement
Role checks are performed at every API route after workspace context is resolved:requireSettingsAccess defines the minimum required roles. Routes not in the list will receive a 403 response.
Role Capabilities Reference
API Key Management
Key Lifecycle
API keys allow programmatic access to Switchbord’s API. Each key is:- Generated with a cryptographically random value
- Hashed with SHA-256 before storage — the plaintext is shown once at creation
- Scoped to the creating workspace — cannot be used to access other workspaces
- Optionally expiring —
expires_atis enforced at validation time
Timing-Safe Comparison
API key validation usescrypto.timingSafeEqual to prevent timing-based side-channel attacks:
Key Expiry Enforcement
Keys with anexpires_at value are rejected at validation time, even if the hash matches: