wealth/docs/decisions/0062-admin-renders-in-the-b...

1.0 KiB

0062 Admin pages render in the browser behind AdminGuard

Status: Proposed · Area: architecture · Date: 2026-10-11 · Decided by: agent

Context

Every admin page needs a signed-in admin and shows that admin's data. The server render never depends on auth (skill rule), so no admin page has anything the server could render for every visitor.

Decision

  • The server sends each admin page's frame (sidebar, page title) and its same-size skeleton, with noindex. AdminGuard in the (panel) layout restores the session in the browser, then shows the page, sends a guest to /login, or shows no-access to a non-admin.
  • The admin app has no service worker, web app manifest, JSON-LD or caches: it isn't installable or indexable, and it has no public reads.

Alternatives

  • Server-rendered admin pages with forwarded session cookies: breaks the rule that the server never reads the session (0018, 0013).

Consequences

  • Every admin read goes through TanStack Query in the browser. Pages have no server caches.