Documentation Index
Fetch the complete documentation index at: https://docs-terra.withunify.org/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
Terra uses WorkOS AuthKit for authentication, decoupling identity from the database.
Why WorkOS?
Government agencies often require enterprise SSO (SAML, OIDC) with Azure AD, Okta, or Google Workspace. WorkOS makes this configuration, not code.Authentication Flow
Session Management
Sessions are stored as encrypted cookies:- Encrypted with
WORKOS_COOKIE_PASSWORD - HttpOnly (no JavaScript access)
- Secure (HTTPS only in production)
- 7-day expiry
User Sync
On first login, we sync WorkOS user data touser_profiles:
Protected Routes
The middleware checks authentication:Authorization
Role-based access control
Applicant Identity
Portal user management