SysOps: approved_backup — 2026-08-16 11:01 UTC
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user