Skip to content

TokenSourceOptions

Defined in: core/src/auth/token-source.ts:7

Type Parameter Default type
C extends Credential Credential
load(): Promise<C | undefined>;

Defined in: core/src/auth/token-source.ts:10

Read the stored credential. Read it on every call, never cache it: the refresh token rotates, and a cached copy would spend one already used.

Promise<C | undefined>


refresh(credential): Promise<C>;

Defined in: core/src/auth/token-source.ts:14

Trade the credential for a fresh one: createAuthFlow(id, host).refresh.

Parameter Type
credential C

Promise<C>


save(credential): Promise<void>;

Defined in: core/src/auth/token-source.ts:12

Persist a refreshed credential. Awaited before the new token is used.

Parameter Type
credential C

Promise<void>