Ensure Live Backend mode is enforced and clear old Demo localStorage session

This commit is contained in:
Hamza-Ayed
2026-07-25 00:44:11 +03:00
parent 8ec7b9aae6
commit 822cb5963a
2 changed files with 6 additions and 5 deletions
+5 -4
View File
@@ -83,12 +83,13 @@ document.addEventListener('DOMContentLoaded', () => {
// Auth Functions
function checkAuth() {
if (currentUser) {
if (currentUser && currentUser.isLive && currentUser.jwt) {
authWrapper.classList.add('hidden');
if (currentUser.isLive && currentUser.jwt) {
fetchLiveDashboardData();
}
fetchLiveDashboardData();
} else {
// Clear stale/demo session to force fresh Live Backend Login
localStorage.removeItem('siro_admin_user');
currentUser = null;
authWrapper.classList.remove('hidden');
}
}