Skip to content

Commit

Permalink
chore: fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix-ru committed Nov 21, 2024
1 parent f3762b7 commit ea32f8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/runtime/plugin.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/utils/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function _fetch<T>(nuxt: ReturnType<typeof useNuxtApp>, 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')
Expand Down

0 comments on commit ea32f8d

Please sign in to comment.