forked from authts/oidc-client-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRefreshState.ts
More file actions
41 lines (34 loc) · 1.2 KB
/
Copy pathRefreshState.ts
File metadata and controls
41 lines (34 loc) · 1.2 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
// Copyright (C) AuthTS Contributors
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
import type { UserProfile } from "./User";
/**
* Fake state store implementation necessary for validating refresh token requests.
*
* @public
*/
export class RefreshState {
/** custom "state", which can be used by a caller to have "data" round tripped */
public readonly data?: unknown;
public readonly refresh_token: string;
public readonly id_token?: string;
public readonly session_state: string | null;
public readonly scope?: string;
public readonly profile: UserProfile;
public readonly resource?: string | string[];
constructor(args: {
refresh_token: string;
id_token?: string;
session_state: string | null;
scope?: string;
profile: UserProfile;
state?: unknown;
}, resource?: string | string[]) {
this.refresh_token = args.refresh_token;
this.id_token = args.id_token;
this.session_state = args.session_state;
this.scope = args.scope;
this.profile = args.profile;
this.resource = resource;
this.data = args.state;
}
}