From fad51c81b2974ff8c8b8745f3f58a9f1b19ef4f0 Mon Sep 17 00:00:00 2001 From: DashCaddy Polish Loop Date: Sun, 13 Sep 2026 02:39:21 -0700 Subject: [PATCH] [grade=A] Register sec.sami dashboard in DashCaddy login-page map MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add 'sec' to the buildLoginPage pages map in sso-gate.js. Without it, /api/v1/auth/login-page?service=sec returned 404 'Unknown service' — the TOTP login page is built from a hardcoded per-service map, so adding sec to services.json (runtime config, gitignored) alone was not enough. sec needs no app-token (plain web app behind the TOTP gate): after check-session verifies the session it redirects to /?direct=1, bypassing the Caddy @needsAutoLogin loop. Codex grade A (urn:ump:p3jkreyxpqikwt54uxgpl7sybkbsnklbs5kdonq5ejfqyh27udla). --- dashcaddy-api/routes/auth/sso-gate.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dashcaddy-api/routes/auth/sso-gate.js b/dashcaddy-api/routes/auth/sso-gate.js index 00c48b2..cf60f25 100644 --- a/dashcaddy-api/routes/auth/sso-gate.js +++ b/dashcaddy-api/routes/auth/sso-gate.js @@ -388,6 +388,16 @@ ft('chat').then(function(r){return r.text()}).then(function(t){ fail('Auto-login unavailable. Open Emby manually or '+authLink('re-authenticate at DashCaddy'),'API: '+JSON.stringify(j)) }).catch(function(e){fail('Could not reach DashCaddy. Open Emby manually','Error: '+(e&&e.message||'unknown'))})` }, + sec: { + // sec.sami — fleet security dashboard. Unlike media apps it needs NO + // app-specific token: it's a plain web app behind the TOTP gate. The + // SHELL above has already verified check-session returned authenticated + // (otherwise it redirected to status.sami), so here we simply enter the + // dashboard. ?direct=1 bypasses the Caddy @needsAutoLogin redirect that + // sends bare "/" back to /dashcaddy-login, avoiding a loop. + title: 'Signing in to Security...', bg: '#070b10', accent: '#58a6ff', + body: `d.textContent='Session verified, opening dashboard...';go('/?direct=1');` + }, }; const cfg = pages[service];