Base session service class for both cookie and local storage session service

Abstract

Hierarchy

Implements

Constructors

Properties

MAX_RETRY_ATTEMPTS: number = 15
opts: undefined | SessionServiceInitializer

Methods

  • Type Parameters

    • T

    • U extends object

    Parameters

    • method: "get" | "delete" | "post" | "patch"
    • url: string
    • headers: Partial<RawAxiosHeaders & {
          Accept: AxiosHeaderValue;
          Authorization: AxiosHeaderValue;
          Content-Encoding: AxiosHeaderValue;
          Content-Length: AxiosHeaderValue;
          User-Agent: AxiosHeaderValue;
      } & {
          Content-Type: ContentType;
      }>
    • Optional body: U
    • options: AxiosRequestOptions = ...

    Returns Promise<T>

  • Return the request headers that would normally be used with an axios request Useful if you need to make a request via a different method and just need the headers

    Parameters

    Returns Record<string, undefined | null | string | string[]>

  • Type Parameters

    • T

    • U extends object

    Parameters

    • method: "get" | "delete" | "post" | "patch"
    • url: string
    • Optional body: U
    • Optional options: AxiosRequestOptions

    Returns Promise<T>

  • Update the session state with the given data.

    If a userId is provided, the session will be set as logged in (or logged out if null). Call after a successful login or refresh.

    Otherwise, this can be used to update tenantId and other session-based variables

    Parameters

    Returns void

Generated using TypeDoc