From 822cb5963a7caa3bb662b4e1bff0aa3a6aec0f2a Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Sat, 25 Jul 2026 00:44:11 +0300 Subject: [PATCH] Ensure Live Backend mode is enforced and clear old Demo localStorage session --- dashboard/siro-admin/index.html | 2 +- dashboard/siro-admin/js/app.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dashboard/siro-admin/index.html b/dashboard/siro-admin/index.html index dfde2aa1..33174c4c 100644 --- a/dashboard/siro-admin/index.html +++ b/dashboard/siro-admin/index.html @@ -40,7 +40,7 @@
- +
diff --git a/dashboard/siro-admin/js/app.js b/dashboard/siro-admin/js/app.js index 128b5231..ac693332 100644 --- a/dashboard/siro-admin/js/app.js +++ b/dashboard/siro-admin/js/app.js @@ -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'); } }