as
This commit is contained in:
@@ -6,7 +6,7 @@ async function ensureAuthenticated() {
|
||||
try {
|
||||
const me = await apiAction('auth.me', { method: 'GET' });
|
||||
if (!me?.ok || !me?.user) {
|
||||
// window.location.href = '/login.php';
|
||||
window.location.href = '/login.php';
|
||||
return false;
|
||||
}
|
||||
window.__currentUser = me.user;
|
||||
|
||||
@@ -35,7 +35,7 @@ async function apiFetch(url, init = {}) {
|
||||
});
|
||||
if (res.status === 401) {
|
||||
if (!disableAuthRedirect) {
|
||||
//window.location.href = "/login.php";
|
||||
window.location.href = "/login.php";
|
||||
}
|
||||
throw new Error("unauthorized");
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ async function ensureAuthenticated() {
|
||||
try {
|
||||
const me = await apiAction('auth.me', { method: 'GET' });
|
||||
if (!me?.ok || !me?.user) {
|
||||
// window.location.href = '/login.php';
|
||||
window.location.href = '/login.php';
|
||||
return false;
|
||||
}
|
||||
window.__currentUser = me.user;
|
||||
|
||||
Reference in New Issue
Block a user