File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,6 @@ class OAuthInterceptor extends RequestInterceptor {
16
16
FutureOr <Request > onRequest (Request request) async {
17
17
final token = await oauthChopper.token;
18
18
if (token == null ) return request;
19
- return request.addAuthorizationHeader (token.accessToken);
19
+ return request.addAuthorizationHeader (token.idToken ?? token. accessToken);
20
20
}
21
21
}
Original file line number Diff line number Diff line change @@ -4,14 +4,18 @@ class OAuthToken {
4
4
final String accessToken;
5
5
final String ? refreshToken;
6
6
final DateTime ? expiration;
7
+ final String ? idToken;
7
8
8
- bool get isExpired =>
9
- expiration != null && DateTime .now ().isAfter (expiration! );
9
+ bool get isExpired {
10
+ bool expired = expiration != null && DateTime .now ().isAfter (expiration! );
11
+ return expired;
12
+ }
10
13
11
14
const OAuthToken ._(
12
15
this .accessToken,
13
16
this .refreshToken,
14
17
this .expiration,
18
+ this .idToken,
15
19
);
16
20
17
21
factory OAuthToken .fromJson (String json) {
@@ -23,5 +27,6 @@ class OAuthToken {
23
27
credentials.accessToken,
24
28
credentials.refreshToken,
25
29
credentials.expiration,
30
+ credentials.idToken,
26
31
);
27
32
}
You can’t perform that action at this time.
0 commit comments