v2.5.0: remove local web admin token gate

This commit is contained in:
Виталий Литвинов
2026-04-24 22:00:08 +03:00
parent 8804319e19
commit 008143a617
10 changed files with 15 additions and 136 deletions

View File

@@ -36,10 +36,6 @@ async function api(path, options = {}) {
};
if (options.body && !headers["Content-Type"]) headers["Content-Type"] = "application/json";
const res = await fetch(path, { ...options, headers, credentials: "same-origin" });
if (res.status === 401) {
$("#authLock").classList.remove("hidden");
throw new Error("Unauthorized");
}
const data = await res.json().catch(() => ({}));
if (!res.ok || data.ok === false) throw new Error(data.error || `HTTP ${res.status}`);
return data.data ?? data;