refactor(auth): remove sessionGateEnabled — gate is always on #538
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!538
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/537"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rips out the
sessionGateEnabledflag and theauth.session_gate_enabledconfig entry — the session gate is now unconditional, fixing the blank-screen-on-fresh-deploy bug (#537).makeSessionGateMiddlewareno longer accepts{ enabled }. Configs that still carryauth.session_gate_enabledget a deprecation warning at boot and the field is ignored. The SPA__root.tsxadds a/whoamiprobe on mount to redirect to/loginon 401 as defense-in-depth.Test plan
session-middleware.test.ts: removed disabled-mode test; added "gates every non-exempt path" multi-route assertionwebhook-config.test.ts: replacedsessionGateEnabledassertions with deprecation-no-throw testCloses #537
Verified locally:
bun run typecheckclean,bun test apps/servergreen except 4 pre-existing fails on main (3× session JSONL pruning, 1× foreman session CRUD listSessions) — unrelated to this PR.Closes #537. Smaller scope than the parallel #539 (which I'm closing — the
/api/*prefix work it carried will be reopened as a separate follow-up issue, since it's an orthogonal cleanup and shouldn't gate the blank-screen fix).Note for the dev follow-up: this PR keeps the hardcoded exempt list. Two extras that should land soon (operator hit them today during sign-in):
loginError()inforgejo-oauth.tsshould addread:usertoFORGEJO_SCOPES(currentlyread:repository write:repository write:hook— operator's first OAuth round-trip got403on/api/v1/userprofile fetch)buildInitHrefinroutes/login.tsxcaptures the current path asreturn, which loops the operator back to the login page after callback. Should fall back to/when the current path is/loginor/app/loginapp-shell.tsxusescfg.auth.authelia_logout_urlfrom/whoami. With Authelia ripped on the proxy side today, the cleaner pattern is<form method="POST" action="/logout">hitting the native session-clear endpointI have working diffs for all three locally; will open a follow-up PR after this merges.