fix(proxy): keep admin login and assets working on plain-HTTP hosts #63

Merged
Simo merged 1 commits from fix/http-auth-csp into main 2026-10-28 22:05:21 +01:00
1 Commits
Author SHA1 Message Date
SimoandClaude Opus 5.5 fa34efd3f0 fix(proxy): keep admin login and assets working on plain-HTTP hosts
CI / check (push) Skipped
CI / tests-unit (push) Skipped
CI / tests-integration (push) Skipped
CI / tests-ui (push) Skipped
CI / preflight (push) Skipped
CI / check (pull_request) Successful in 38s
CI / tests-imaging-browsers (pull_request) Skipped
CI / tests-quality (pull_request) Skipped
CI / tests-unit (pull_request) Failing after 36s
CI / tests-integration (pull_request) Successful in 2m36s
CI / tests-ui (pull_request) Successful in 6m21s
CI / preflight (pull_request) Skipped
CI / deploy (pull_request) Skipped
The /admin guard always read the `__Secure-` session cookie, but Auth.js
only uses that name when AUTH_URL (or the request) is HTTPS. With an
http:// AUTH_URL a signed-in admin was bounced between /admin and /login
until the browser threw "too many history calls". The guard now picks the
cookie name the same way Auth.js does.

The CSP also sent `upgrade-insecure-requests` to plain-HTTP visitors, so
the browser rewrote same-origin fonts/scripts to https:// where nothing
listens. It is now only sent when the visitor reached us over HTTPS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 22:00:20 +01:00