This commit is contained in:
2025-12-08 03:08:36 +01:00
parent e3d8932cd5
commit 7235c89e56
3 changed files with 3 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ async function ensureAuthenticated() {
try { try {
const me = await apiAction('auth.me', { method: 'GET' }); const me = await apiAction('auth.me', { method: 'GET' });
if (!me?.ok || !me?.user) { if (!me?.ok || !me?.user) {
// window.location.href = '/login.php'; window.location.href = '/login.php';
return false; return false;
} }
window.__currentUser = me.user; window.__currentUser = me.user;

View File

@@ -35,7 +35,7 @@ async function apiFetch(url, init = {}) {
}); });
if (res.status === 401) { if (res.status === 401) {
if (!disableAuthRedirect) { if (!disableAuthRedirect) {
//window.location.href = "/login.php"; window.location.href = "/login.php";
} }
throw new Error("unauthorized"); throw new Error("unauthorized");
} }

View File

@@ -16,7 +16,7 @@ async function ensureAuthenticated() {
try { try {
const me = await apiAction('auth.me', { method: 'GET' }); const me = await apiAction('auth.me', { method: 'GET' });
if (!me?.ok || !me?.user) { if (!me?.ok || !me?.user) {
// window.location.href = '/login.php'; window.location.href = '/login.php';
return false; return false;
} }
window.__currentUser = me.user; window.__currentUser = me.user;