diff --git a/app/middleware/auth.global.js b/app/middleware/auth.global.js index 27c6fd8..d2a8416 100644 --- a/app/middleware/auth.global.js +++ b/app/middleware/auth.global.js @@ -6,10 +6,10 @@ export default defineNuxtRouteMiddleware(async (to, next) => { const auth = status.value === "authenticated" ? true : false; const isProtected = (await to.meta.auth) === true ? true : false; if (!auth && isProtected) { - console.log("User is not authenticated and page is protected"); - return navigateTo("/login"); + // User is not authenticated and page is protected + return abortNavigation(); } else if (auth && !isProtected) { - console.log("User is authenticated and page is not protected"); - return navigateTo("/"); + // User is authenticated and page is not protected + return abortNavigation(); } });