Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Reauthenticate

Hierarchy

  • Reauthenticate

Callable

  • Reauthenticate(request: Request): Promise<void>
  • Invoked when a 401 error is returned on a Response. Indicates that the user's authentication token is invalid and should be regenerated. Typically, a reauth function will add a Proxy rule to ensure the token is applied in the correct format (e.g. as an Authorize header) and on the correct Requests (e.g. Requests with a specific base). Another approach is to make a network call that returns an updated Set-Cookie response header so that future requests contain an updated JWT value.

    Parameters

    • request: Request

      The request that failed with an authentication error.

    Returns Promise<void>

    A promise that will be resolved when the user's authentication token has been retrieved and any corresponding Proxy rules have been applied.