TokenStoreInterface
in
Somewhere durable to keep the OAuth grant.
A device sign-in needs a person, so its refresh token must survive restarts: without it, every start would ask them to sign in again. YouTube reads the store at start and writes every new token payload through to it.
Tags
Table of Contents
Methods
- load() : array{access_token?: string, refresh_token?: string, expires_at?: int}
- What was stored, or an empty array when nothing has been saved yet.
- save() : void
- Keeps a token payload, as any grant returns it.
Methods
load()
What was stored, or an empty array when nothing has been saved yet.
public
load() : array{access_token?: string, refresh_token?: string, expires_at?: int}
Return values
array{access_token?: string, refresh_token?: string, expires_at?: int}save()
Keeps a token payload, as any grant returns it.
public
save(array{access_token: string, refresh_token?: string|null, expires_in?: int|null, expires_at?: int|null, scope?: list|null, token_type?: string|null} $token) : void
Implementations must tolerate partial payloads: a refresh returns no refresh token, because the old one keeps working.
Parameters
-
$token
: array{access_token: string, refresh_token?: string|null, expires_in?: int|null, expires_at?: int|null, scope?: list
|null, token_type?: string|null}