From ea32f8d07884a8babdb5fcab6de4d2161fe0ceba Mon Sep 17 00:00:00 2001 From: Marsel Shayhin Date: Thu, 21 Nov 2024 17:36:50 +0100 Subject: [PATCH] chore: fix linting --- src/runtime/plugin.ts | 5 +++-- src/runtime/utils/fetch.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/runtime/plugin.ts b/src/runtime/plugin.ts index 1e77daea..a00dd043 100644 --- a/src/runtime/plugin.ts +++ b/src/runtime/plugin.ts @@ -1,8 +1,8 @@ import { getHeader } from 'h3' import authMiddleware from './middleware/auth' import { getNitroRouteRules } from './utils/kit' -import { _refreshHandler, addRouteMiddleware, defineNuxtPlugin, useAuth, useAuthState, useRuntimeConfig } from '#imports' import { FetchConfigurationError } from './utils/fetch' +import { _refreshHandler, addRouteMiddleware, defineNuxtPlugin, useAuth, useAuthState, useRuntimeConfig } from '#imports' export default defineNuxtPlugin(async (nuxtApp) => { // 1. Initialize authentication state, potentially fetch current session @@ -42,7 +42,8 @@ export default defineNuxtPlugin(async (nuxtApp) => { if (shouldFetchSession) { try { await getSession() - } catch (e) { + } + catch (e) { // Do not throw the configuration error as it can lead to infinite recursion if (!(e instanceof FetchConfigurationError)) { throw e diff --git a/src/runtime/utils/fetch.ts b/src/runtime/utils/fetch.ts index eca58272..3294ca52 100644 --- a/src/runtime/utils/fetch.ts +++ b/src/runtime/utils/fetch.ts @@ -11,7 +11,7 @@ export async function _fetch(nuxt: ReturnType, path: strin // Prevent callback recursion when doing internal routing if (runtimeConfig.public.auth.disableInternalRouting === false) { const currentPath = nuxt.ssrContext?.event?.path - // const isErrorUrl = nuxt.ssrContext?.error && + // const isErrorUrl = nuxt.ssrContext?.error && if (currentPath?.startsWith(joinedPath)) { console.error(`${ERROR_PREFIX} Recursion detected at ${joinedPath}. Have you set the correct \`auth.baseURL\`?`) throw new FetchConfigurationError('Server configuration error')