@creator.co/module-identity-client - v1.1.11
    Preparing search index...

    Represents a Persistent Session class that manages session data using cookies.

    Index

    Constructors

    Properties

    storage: default

    Represents a storage object for cookies.

    Methods

    • Clears the session data by setting it to null and cleaning specific keys from storage. If logging is not disabled, a debug message is logged.

      Returns Promise<void>

      A promise that resolves once the data is cleared.

    • Retrieves external providers from storage and parses them into a FederationProvidersResponse object.

      Returns Promise<FederationProvidersResponse>

      A Promise that resolves to the external providers stored in the storage or null if no providers are found.

    • Asynchronously retrieves the public key from storage.

      Returns Promise<any>

      The public key if found, otherwise null.

    • Retrieves the renewal token from the session data or storage. If the renewal token is already present in the session data, it is returned. Otherwise, it is retrieved from storage and stored in the session data for future use.

      Returns Promise<undefined | string>

      The renewal token.

    • Retrieves the resources token from the session data or storage. If the token is already present in the session data, it returns that token. Otherwise, it retrieves the token from storage and stores it in the session data for future use.

      Returns Promise<undefined | string>

      The resources token.

    • Retrieves the token from the session data or storage if not already present.

      Returns Promise<undefined | string>

      The token value.

    • Asynchronously retrieves user data from storage.

      Returns Promise<any>

      A promise that resolves to the user data retrieved from storage.

    • Retrieves the user object asynchronously. If the user object is already present in the session data, it returns the user object. Otherwise, it fetches the user data, updates the session data with the user data, and returns the user object.

      Returns Promise<any>

      A promise that resolves to the user object.

    • Saves the external providers data to the storage.

      Parameters

      • externalProviders: any

        The external providers data to be saved.

      Returns Promise<void>

      A promise that resolves once the data is saved.

    • Saves the public key to the storage with the specified expiration time.

      Parameters

      • pk: string

        The public key to be saved.

      Returns Promise<void>

      A promise that resolves once the public key is saved.

    • Saves the session data to local storage along with necessary tokens and metadata.

      Parameters

      • session: any

        The session data to be saved.

      Returns Promise<void>

      • A promise that resolves once the session data is saved.