Options
All
  • Public
  • Public/Protected
  • All
Menu

Module redux/tokenInterceptors

Index

Functions

Const addTokenHeader

  • addTokenHeader(config: AxiosRequestConfig): AxiosRequestConfig
  • Always add the current JWT token to a request

    Parameters

    • config: AxiosRequestConfig

      Request config to modify

    Returns AxiosRequestConfig

Const handleTokenError

  • handleTokenError(error: AxiosError<any>): Promise<never>
  • Trigger a refresh if there's an authentication error

    Parameters

    • error: AxiosError<any>

      Error to inspect

    Returns Promise<never>

Const handleTokenResponse

  • handleTokenResponse(response: AxiosResponse<any>): AxiosResponse<any>
  • Check if there's a token in the headers, or trigger a refresh if there's an error

    Parameters

    • response: AxiosResponse<any>

      Response to inspect

    Returns AxiosResponse<any>

Generated using TypeDoc