JWT & Sessions
Token Issuance
Tokens are issued bybuildAuthSession() after successful authentication:
Token Lifecycle
| Event | Action |
|---|---|
| Login | Issue new JWT |
| Center switch | Reissue with new centerId |
| Token refresh | Reissue with extended expiry |
| Logout | Invalidate session |
Multi-Tenant Session
A single JWT carries the current tenant context. When switching centers:- Verify actor has active membership in target center
- Reissue JWT with new
centerIdanddomainRoles - Client refreshes with new token