Skip to content

Authentication

Flow

The app uses a single source of truth for the current user: useAuthenticatedUser() from frontend/apps/eu-home-app/utils/auth.ts.

  • It calls GET /alaners/authenticated (via the eu-home API).
  • The result is cached in TanStack Query under ["users", "authenticated"] with a 5-minute stale time.
  • The same user is also written into ["users", slack_handle] and ["users", id] so other hooks (e.g. useUser) can reuse it.

For now, only Alaners can access Alan Home, and they need to go through Cloudflare WARP ⧉, allowing us to authentify them without additional work.