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:
committed by
GitHub
parent
a40ea61415
commit
13c686a8a1
23
app/sovran_systemsos_web/static/js/security.js
Normal file
23
app/sovran_systemsos_web/static/js/security.js
Normal 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user