diff --git a/frontend/static/js/index.js b/frontend/static/js/index.js index 5b5247e..fa5eda6 100644 --- a/frontend/static/js/index.js +++ b/frontend/static/js/index.js @@ -125,7 +125,7 @@ const router = async(uri) => { window.addEventListener("popstate", function() {router(location.pathname)}); -document.addEventListener("DOMContentLoaded", () => { +document.addEventListener("DOMContentLoaded", async () => { document.body.addEventListener("click", e => { if (e.target.matches("[data-link]")) { e.preventDefault(); @@ -136,6 +136,7 @@ document.addEventListener("DOMContentLoaded", () => { navigateTo(e.target.href.slice(location.origin.length)); } }); + await client.isAuthentificate(); router(location.pathname); document.querySelector('a[href=\'' + location.pathname + '\']')?.classList.add('active'); });