This commit is contained in:
2025-12-08 03:10:39 +01:00
parent 7235c89e56
commit f5178c8cd5
2 changed files with 6 additions and 2 deletions

View File

@@ -6,7 +6,9 @@ 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'; if (!window.DISABLE_AUTH_REDIRECT) {
window.location.href = '/login.php';
}
return false; return false;
} }
window.__currentUser = me.user; window.__currentUser = me.user;

View File

@@ -11,7 +11,9 @@ 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'; if (!window.DISABLE_AUTH_REDIRECT) {
window.location.href = '/login.php';
}
return false; return false;
} }
window.__currentUser = me.user; window.__currentUser = me.user;