diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 7180be26..f0e0e0c3 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -9,7 +9,7 @@ import CreateDiscussion from "@/views/discussions/CreateDiscussion.vue"; import CallbackPage from "@/views/CallbackPage.vue"; import UserClasses from "@/views/classes/UserClasses.vue"; import UserAssignments from "@/views/classes/UserAssignments.vue"; -import authState from "@/services/auth/auth-service.ts"; +import authService from "@/services/auth/auth-service.ts"; import LearningPathPage from "@/views/learning-paths/LearningPathPage.vue"; import LearningPathSearchPage from "@/views/learning-paths/LearningPathSearchPage.vue"; import UserHomePage from "@/views/homepage/UserHomePage.vue"; @@ -145,7 +145,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 (!authState.isLoggedIn.value) { + if (!authService.isLoggedIn.value) { next("/login"); } else { next();