SysOps: approved_backup — 2026-08-16 11:01 UTC

This commit is contained in:
sysops
2026-08-16 11:01:58 +00:00
parent 22a17ed048
commit 1dd607b060
46 changed files with 3734 additions and 147 deletions
+4
View File
@@ -30,6 +30,10 @@ window.Cockpit = (function () {
const fetchOpts = Object.assign({}, options, { headers: headers });
if (options.signal) fetchOpts.signal = options.signal;
const res = await fetch(url, fetchOpts);
if (res.status === 401 && !String(url).includes('/api/auth/login')) {
location.href = '/login?next=' + encodeURIComponent(location.pathname + location.search);
throw new Error('Niet ingelogd');
}
let data = null;
try { data = await res.json(); } catch (e) { data = null; }
if (!res.ok) {