From 20e7cc95fa0ea08e40ebdcaf22790137e022aab6 Mon Sep 17 00:00:00 2001 From: manchenkoff Date: Fri, 5 Apr 2024 01:38:52 +0200 Subject: [PATCH] fix: prevent infinite redirect for guests --- src/runtime/httpFactory.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/runtime/httpFactory.ts b/src/runtime/httpFactory.ts index 5ab71fd..092156f 100644 --- a/src/runtime/httpFactory.ts +++ b/src/runtime/httpFactory.ts @@ -114,21 +114,6 @@ export function createHttpClient(): $Fetch { async onResponseError({ response }): Promise { if (response.status === 401) { user.value = null; - - const currentRoute = nuxtApp.$router.currentRoute.value; - - if ( - options.redirect.onLogout === false || - options.redirect.onLogout === currentRoute.path || - options.redirect.onAuthOnly === currentRoute.path || - options.globalMiddleware.enabled === true - ) { - return; - } - - await nuxtApp.runWithContext(() => - navigateTo(options.redirect.onLogout as string) - ); } }, };