Auth / Auth and Guard

Keep keys, fresh lookups, and hosts aligned

  • Share one principal key: Pass Policy.key to AuthServer.resolver so client subject checks (Me.key and AuthServer.answered) match server identity.
  • Look up fresh principals: Load User from your database per request by subjectId instead of trusting login-time claims that miss role revocations.
  • Use the right host resolver: Pair serveFetch with pageReader (requests: 'navigation') using AuthServer.host, and use requests: 'browser' for WebSocket sync hosts (documentHost) where browsers omit custom CSRF headers.
  • Validate at startup: Run GuardServer.validate(Policy, ...) at boot so an unguarded Source fails immediately.

Next