Authentication behavior for the fetch implementation.
Optionalfetch?: (input: string | URL | Request, init?: RequestInit) => Promise<Response>Fetch implementation used to send requests. Defaults to global fetch.
Return an access token for a request.
When forceRefresh is true, the previous token was rejected with a 401
and the provider should refresh it before returning. Providers own token
storage and refresh-token rotation.
OptionalonUnauthorized?: (response: Response) => void | Promise<void>Called when the request is still unauthorized after one refresh.
Create a fetch implementation that supplies a bearer token and refreshes it after a 401 response.
Refresh calls are coalesced so concurrent unauthorized requests rotate a refresh token only once. Each request is retried at most once.