feat: add legacy security warning API and UI modal for pre-factory-seal machines

Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/f7c8f11b-873b-403f-ac55-8b5b7cd9f1fb

Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-07 15:49:25 +00:00
committed by GitHub
parent a40ea61415
commit 13c686a8a1
6 changed files with 147 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
"use strict";
// ── Legacy security warning ───────────────────────────────────────
function openSecurityWarningModal(message) {
if ($securityWarningMessage) $securityWarningMessage.textContent = message;
if ($securityWarningModal) $securityWarningModal.classList.add("open");
}
function closeSecurityWarningModal() {
if ($securityWarningModal) $securityWarningModal.classList.remove("open");
}
async function checkLegacySecurity() {
try {
var data = await apiFetch("/api/security/status");
if (data && data.status === "legacy") {
openSecurityWarningModal(data.warning || "This machine may have a known factory password. Please change your passwords immediately.");
}
} catch (_) {
// Non-fatal — silently ignore if the endpoint is unreachable
}
}