Skip to content

Commit

Permalink
fix(#927): fix minor nuxt warning
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix-ru committed Dec 12, 2024
1 parent d24f96f commit ab7033c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/runtime/utils/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { callWithNuxt, useRuntimeConfig } from '#app'
import type { useNuxtApp } from '#imports'

export async function _fetch<T>(nuxt: ReturnType<typeof useNuxtApp>, path: string, fetchOptions?: Parameters<typeof $fetch>[1]): Promise<T> {
const runtimeConfig = await callWithNuxt(nuxt, useRuntimeConfig)
// This fixes https://github.com/sidebase/nuxt-auth/issues/927
const runtimeConfigOrPromise = callWithNuxt(nuxt, useRuntimeConfig)
const runtimeConfig = 'public' in runtimeConfigOrPromise ? runtimeConfigOrPromise : await runtimeConfigOrPromise

const joinedPath = resolveApiUrlPath(path, runtimeConfig)

// Prevent callback recursion when doing internal routing
Expand Down

0 comments on commit ab7033c

Please sign in to comment.