Skip to content

Cookie login/logout, services-assent theme port, dead-code cleanup - #21

Merged
alihussainiF1 merged 2 commits into
mainfrom
feat/auth-login-theme-cleanup
Aug 17, 2026
Merged

Cookie login/logout, services-assent theme port, dead-code cleanup#21
alihussainiF1 merged 2 commits into
mainfrom
feat/auth-login-theme-cleanup

Conversation

@alihussainiF1

Copy link
Copy Markdown
Collaborator

What changed

Proper logout (and the login it required)

There was no session to log out of — auth was a static bearer token the SPA never sent, and the old logout button had been deleted. This adds the minimal real flow on top of the existing API_TOKEN:

  • POST /api/login exchanges the token for an HttpOnly SameSite=Lax cookie (constant-time compare, 20/min rate limit); POST /api/logout clears it; GET /api/session reports auth state.
  • requireAuth middleware now accepts bearer header or the session cookie. No users table, no session store — the cookie stores the token itself (marked with a ponytail: comment; switch to signed session IDs if per-session revocation is ever needed).
  • Frontend: new /login page, a pathless session-gated layout route around the app shell, 401s redirect to /login, and Log Out is back in the account menu. AUTH_DISABLED=true (dev default) bypasses the gate.

Theme + layout (services-assent port)

  • Kills the sidebar/header border T-junction: the sidebar now sits on its own surface (#f9f9fb light / #141413 dark) with no borders, and the header divider starts at the content column.
  • Light-mode neutrals moved to the oklch hue-245 blue-grey family; body font is now Inter Variable (Uncut Sans removed); architecture-canvas dot grid toned down.

Dead-code cleanup (net −270 lines)

  • Deleted unreachable features/deployments/components.tsx (+test, 387 lines).
  • Deleted no-op authHeaders()/withAccessToken() stubs.
  • Deleted global searchQuery store state — its input was removed in July, so five routes filtered on a permanently empty string.
  • Removed the redundant sidebar_state cookie write.

Reviewer notes

  • web/src/router.tsx restructures routes under a pathless app layout; page routes are otherwise unchanged.
  • /applications, /registries, /proxy remain reachable only by URL (no nav entry) — left as-is, flagging for a product decision.
  • Verified: go test ./..., vitest 108/108, tsc, eslint (0 errors), production build, plus a live end-to-end check (login → shell → logout → gate redirect) in light and dark themes.

🤖 Generated with Claude Code

alihussainiF1 and others added 2 commits August 17, 2026 12:37
- Add minimal auth flow over the existing API_TOKEN: POST /api/login sets
  an HttpOnly session cookie (rate-limited, constant-time compare),
  POST /api/logout clears it, GET /api/session reports state; the auth
  middleware now accepts bearer token or cookie. Frontend gains a /login
  page, a session-gated app layout, 401 redirects, and a Log Out menu item.
- Port the services-assent look: oklch hue-245 neutral palette, Inter
  Variable body font, sidebar on its own surface with no borders so the
  header divider starts at the content column (no nav/header border cross).
- Delete dead code: unreachable deployments components module, no-op
  authHeaders/withAccessToken stubs, orphaned global searchQuery state and
  its five dead filter sites, redundant sidebar_state cookie write.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@alihussainiF1
alihussainiF1 merged commit 86be19a into main Aug 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant