fix(frontend): Login state blijft behouden voor andere tabs binnen dezelfde browser.

This commit is contained in:
Gerald Schmittinger 2025-04-22 11:04:24 +02:00
parent 37c9e622e6
commit 2578555ace
4 changed files with 17 additions and 4 deletions

View file

@ -138,7 +138,7 @@ const router = createRouter({
router.beforeEach(async (to, _from, next) => {
// Verify if user is logged in before accessing certain routes
if (to.meta.requiresAuth) {
if (!authService.isLoggedIn.value) {
if (!authService.isLoggedIn.value && !await authService.loadUser()) {
next("/login");
} else {
next();