feat: login redirect opgelost

This commit is contained in:
Joyelle Ndagijimana 2025-03-18 09:25:18 +01:00
parent 37ecad30ea
commit 49f1a98eec
2 changed files with 11 additions and 10 deletions

View file

@ -109,9 +109,9 @@ const router = createRouter({
});
router.beforeEach(async (to, from, next) => {
// Verify if user is logged in for paths that require authentication
// Verify if user is logged in before accessing certain routes
if (to.meta.requiresAuth) {
if (!authState.isLoggedIn) {
if (!authState.isLoggedIn.value) {
next("/login");
} else {
next();