Class TokenStorageServiceAbstract

Abstract class representing a token storage service. Provides methods to set and get items in storage, and abstract methods to check and manage cached tokens.

Hierarchy (view full)

Constructors

Properties

The configuration for the web core.

prefix: string = 'lemon'
storage: Storage = ...

Methods

  • Gets all items from the storage.

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

    • A promise that resolves to an object containing all items.
  • Gets an item from the storage.

    Parameters

    • key: string

      The key to get.

    Returns Promise<string>

    • A promise that resolves to the value of the item.
  • Checks if there is a cached token in the storage.

    Returns Promise<boolean>

    • A promise that resolves to true if a cached token exists, false otherwise.
  • Sets an item in the storage.

    Parameters

    • key: string

      The key to set.

    • value: string

      The value to set.

    Returns Promise<void>

    • A promise that resolves when the item is set.
  • Checks if the cached token should be refreshed.

    Returns Promise<boolean>

    • A promise that resolves to true if the token should be refreshed, false otherwise.