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

    Represents a session with methods for managing user authentication and session data.

    Index

    Constructors

    Properties

    authorization: null | default

    Represents the authorization status of a session.

    data: default

    Represents a persistent session data object. This property is read-only.

    Methods

    • Clears the session by setting the authorization to null and clearing data asynchronously.

      Returns Promise<void>

      A promise that resolves once the session is cleared.

    • Asynchronously retrieves a public token by enqueuing a public key request.

      Returns Promise<string>

      A promise that resolves with the public token.

    • Retrieves the token for authorization, optionally revalidating it if needed.

      Parameters

      • Optionalrevalidate: boolean

        Flag indicating whether to revalidate the token.

      Returns Promise<null | string>

      A promise that resolves to the token if valid, or null if revalidation is required.

    • Checks if the user is logged in by verifying the validity of the authorization token.

      Returns boolean

      A boolean value indicating whether the user is logged in or not.

    • Asynchronously loads a session based on the provided parameters.

      Parameters

      • OptionalforceReload: boolean

        Whether to force a reload of the session.

      • OptionaloptRedirectUrl: string

        Optional redirect URL.

      • OptionaloptExtraContext: any

        Optional extra context data.

      Returns Promise<null | string | boolean | AuthorizationResponse | ErrorResponse>

      • True if the session was successfully loaded, false otherwise.
    • Sets the session data with the provided token and updates the authorization object.

      Parameters

      • data: any

        The data object containing the token.

      Returns Promise<void>

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