Update index.html
1 file changed+1−17
index.html+1−17View file
| @@ -1538,23 +1538,7 @@ | ||
| } | ||
| } | ||
| - if (authToken) { | ||
| - try { | ||
| - const res = await apiFetch('/api/auth/me'); | ||
| - if (res.ok) { | ||
| - const data = await res.json(); | ||
| - currentUser = data.user || data; | ||
| - localStorage.setItem(AUTH_USER_KEY, JSON.stringify(currentUser)); | ||
| - } else if (res.status === 401) { | ||
| - logout(false); | ||
| - return; | ||
| - } | ||
| - } catch (err) { | ||
| - console.warn('Backend auth unreachable, using local session state:', err); | ||
| - } | ||
| - } | ||
| - | ||
| - if (currentUser) { | ||
| + if (currentUser && authToken) { | ||
| applyUserSession(currentUser); | ||
| } else { | ||
| updateHeaderAuthUI(); | ||