Spaces:
Sleeping
Sleeping
Nathan commited on
Commit ·
301e2f6
1
Parent(s): 7a16c6f
UI: Fixed dashboard entry hang after successful login
Browse files342 unmodified lines343344345346347348349350351352353354355356342 unmodified linesasync function checkAuth() {if (!authToken) return;const res = await fetch('/api/auth/me', { headers: { 'Authorization': `Bearer ${authToken}` } });const d = await res.json();if (d.loggedIn) {userPlan = d.plan || 'free';document.getElementById('user-plan').innerText = userPlan === 'ultra' ? '☢️ GOD MODE' : '🛡️ FREE';initDashboard();updateLogs();initRealtime();}}342 unmodified lines343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373342 unmodified linesasync function checkAuth() {if (!authToken) return;try {const res = await fetch('/api/auth/me', { headers: { 'Authorization': `Bearer ${authToken}` } });const d = await res.json();if (d.loggedIn) {userPlan = d.plan || 'free';const planEl = document.getElementById('user-plan');if (planEl) planEl.innerText = userPlan === 'ultra' ? '☢️ GOD MODE' : '🛡️ FREE';const emailEl = document.getElementById('user-email');if (emailEl) emailEl.innerText = d.email;// Force show container if authenticateddocument.documentElement.classList.add('is-authed');await initDashboard();await updateLogs();await initRealtime();} else {localStorage.removeItem('saas_token');document.documentElement.classList.remove('is-authed');}} catch (e) {console.error("Auth Check Error:", e);// Even on error, if we have a token, try to show the UIdocument.documentElement.classList.add('is-authed');}}
dashboard/index.html+25-8