Interface representing a web core service.

interface WebCoreService {
    getSavedToken(): Promise<{
        [key: string]: string;
    }>;
    getSharedAxiosInstance(): AxiosInstance;
    isAuthenticated(): Promise<boolean>;
    logout(): Promise<void>;
    setUseXLemonIdentity(use): void;
    setUseXLemonLanguage(use, key?): void;
}

Implemented by

Methods

  • Gets the saved token.

    Returns Promise<{
        [key: string]: string;
    }>

    • A promise that resolves to an object containing the saved token.
  • Gets the shared axios instance

    Returns AxiosInstance

    The shared axios instance

  • Checks if the user is authenticated.

    Returns Promise<boolean>

    • A promise that resolves to true if the user is authenticated, false otherwise.
  • Logs out the user.

    Returns Promise<void>

    • A promise that resolves when the user is logged out.
  • Sets the use of X-Lemon-Identity.

    Parameters

    • use: boolean

      Whether to use X-Lemon-Identity.

    Returns void

  • Sets the use of X-Lemon-Language.

    Parameters

    • use: boolean

      Whether to use X-Lemon-Language.

    • Optional key: string

    Returns void