From f1205a92dff05cb6e50e84ddc2f53130b75a0a9e Mon Sep 17 00:00:00 2001 From: clonbg Date: Mon, 11 Aug 2025 17:48:06 +0200 Subject: [PATCH] Replace navigation redirects with abortNavigation --- app/middleware/auth.global.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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(); } });