Interface TokenCache

Interface to implement token caching.

interface TokenCache {
    delete?: (() => void);
    get: (() => null | {
        accessToken: string;
        expires: number;
    });
    set: ((token: string, expires: number) => void);
}

Properties

Properties

delete?: (() => void)

Remove any stored token. Optional: when omitted, an invalidated token is simply overwritten on the next successful authentication.

get: (() => null | {
    accessToken: string;
    expires: number;
})

Get a token and expiration timestamp from storage.

set: ((token: string, expires: number) => void)

Put a token and expiration timestamp into storage.