-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtoken.ts
More file actions
41 lines (38 loc) · 1.09 KB
/
token.ts
File metadata and controls
41 lines (38 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import type { ScopeInterface } from "./scope.ts";
import type { ClientInterface } from "./client.ts";
export interface AccessToken<
Client extends ClientInterface,
User,
Scope extends ScopeInterface,
> {
/** The access token. */
accessToken: string;
/** The expiration time for the access token. */
accessTokenExpiresAt?: Date | null;
/** The client associated with the token. */
client: Client;
/** The user associated with the token. */
user: User;
/** The scope granted to the token. */
scope?: Scope | null;
/** The authorization code used to issue the token. */
code?: string | null;
}
export interface Token<
Client extends ClientInterface,
User,
Scope extends ScopeInterface,
> extends AccessToken<Client, User, Scope> {
/** The refresh token. */
refreshToken?: string | null;
/** The expiration time for the refresh token. */
refreshTokenExpiresAt?: Date | null;
}
export interface RefreshToken<
Client extends ClientInterface,
User,
Scope extends ScopeInterface,
> extends Token<Client, User, Scope> {
/** The refresh token. */
refreshToken: string;
}