@openvireo/sdk - v1.0.0
    Preparing search index...

    Class TokenManager

    Index
    • The access token held now, if it hasn't expired, without refreshing.

      Returns string | null

    • Forget the session locally (after logout, or when the server rejected the refresh token).

      Parameters

      Returns Promise<void>

    • A valid access token, refreshing first if it expires within the margin (or force).

      Parameters

      • opts: { force?: boolean } = {}

      Returns Promise<string>

    • Loads a stored session (e.g. at app start). Returns null when signed out.

      Returns Promise<StoredSession | null>

    • Parameters

      Returns () => void

    • Single-flight refresh: concurrent callers share one request.

      Returns Promise<string>

    • Moves a session set aside back. False when key holds none.

      Parameters

      • key: string

      Returns Promise<boolean>

    • Moves the session to key without ending it (SPEC §21). A refresh under way finishes first, so the token that moves is the newest. Written before it is deleted: a crash between the two leaves both, and the active key wins. False when there is no session to move.

      Parameters

      • key: string

      Returns Promise<boolean>

    • After login/register: keep the session and its first access token.

      Parameters

      Returns Promise<void>

    • Changes fields of the stored session, e.g. the email after it changed (SPEC §16).

      Parameters

      Returns Promise<void>