dragonflight/services/mam-api/src
Zac Gaetano 7e3e6b2a28 fix(auth): force HTTPS on dragonflight.live so login cookies stick
User reported infinite login loop on dragonflight.live. Root cause: openresty
fronts both http:// and https:// without redirecting, and a user landing on
http:// gets the Set-Cookie response silently dropped — cookies are Secure-only
when TRUST_PROXY=true, and the CORS allowlist refuses the http:// origin.
Result: login appears to succeed, next request has no session cookie, AuthGate
bounces back to login.

Two defensive layers (the openresty box is not in our reach):
- web-ui index.html: tiny inline redirect; if location is http://dragonflight.live,
  rewrite to https:// before anything else runs. Bounded to that exact hostname
  so local / LAN access on http://172.18.91.x stays as-is.
- mam-api: emit Strict-Transport-Security on HTTPS responses when AUTH_ENABLED=true.
  After one successful HTTPS visit, browsers auto-upgrade future http:// requests
  on their own — closes the loophole even if someone bypasses the index.html JS.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 22:00:35 -04:00
..
ampp feat: AMPP folder sync integration — pre-create folder hierarchy on upload, expose lookup endpoint for Script Task: client.js 2026-04-18 13:42:07 -04:00
auth fix(mam-api): TRUST_PROXY boot warning + CSRF integration tests + bounded rate-limit map 2026-05-27 15:03:35 -04:00
db fix(migration): replace invalid UUID in 023 dev user seed 2026-05-27 18:45:21 -04:00
middleware feat(auth): bound-hostname tokens for node-agent + return role from /me 2026-05-27 19:27:59 -04:00
routes feat(auth): bound-hostname tokens for node-agent + return role from /me 2026-05-27 19:27:59 -04:00
s3 fix: close all 24 open issues (#40–#94) 2026-05-26 14:10:44 +00:00
tasks Revert "auth: top-to-bottom rework — local accounts, RBAC + client tag, audit log, env-bootstrap" 2026-05-27 03:28:05 +00:00
index.js fix(auth): force HTTPS on dragonflight.live so login cookies stick 2026-05-27 22:00:35 -04:00
scheduler.js chore: 1.2 ship-prep sweep — close 38 issues 2026-05-27 02:06:14 +00:00