diff --git a/assets/app_auth.js b/assets/app_auth.js index 0749463..60817a9 100644 --- a/assets/app_auth.js +++ b/assets/app_auth.js @@ -462,12 +462,8 @@ const footerLoginBtn = document.getElementById('footer-cta-login'); if (footerLoginBtn) footerLoginBtn.style.display = 'inline-flex'; - if (landingBanner) landingBanner.style.display = 'none'; if (navDashLink) navDashLink.style.display = 'none'; - if (mobDashLink) mobDashLink.style.display = 'none'; - const mobLogoutBtn = document.getElementById('mobile-drawer-logout-btn'); - if (mobLogoutBtn) mobLogoutBtn.style.display = 'none'; } // 🔒 Strikter Rollen-Filter für Dozenten- und Admin-Funktionen @@ -713,7 +709,7 @@ }; // Initialisierung beim Laden des DOMs - document.addEventListener('DOMContentLoaded', () => { + function initAuth() { window.AUTH.updateUI(); window.AUTH.checkStatus(); window.AUTH.fetchMe(); @@ -727,5 +723,11 @@ window.location.replace('dashboard.html'); } } - }); + } + + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', initAuth); + } else { + initAuth(); + } })(); diff --git a/index.html b/index.html index 98f3009..933df3c 100644 --- a/index.html +++ b/index.html @@ -10,8 +10,8 @@ - - + +