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
Collaborator

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]

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]>
Simo added 1 commit 2026-10-28 22:05:08 +01:00
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
fa34efd3f0
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]>
Simo merged commit efa6cca1d7 into main 2026-10-28 22:05:21 +01:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: remco/EpicNext-Cms#63