Skip to main content

JWT & Sessions

Token Issuance

Tokens are issued by buildAuthSession() after successful authentication:

Token Lifecycle

Multi-Tenant Session

A single JWT carries the current tenant context. When switching centers:
  1. Verify actor has active membership in target center
  2. Reissue JWT with new centerId and domainRoles
  3. Client refreshes with new token

Security Notes

  • All center access is verified through center_memberships — no direct access
  • basePrisma usage is audited for cross-center operations
  • Cron routes require verifyCronSecret() — 39 routes standardized