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>
24 lines
870 B
JavaScript
24 lines
870 B
JavaScript
"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
|
|
}
|
|
}
|