nextspace
    Preparing search index...

    Function fetchWithTokenRefresh

    • Wrapper for fetch that automatically handles token refresh on 401 responses.

      Parameters

      • url: string

        The URL to fetch

      • options: RequestInit

        Fetch options

      • useStoredTokens: boolean = false

        Whether to automatically use stored tokens for authorization

      Returns Promise<Response>

      Promise with the fetch response