File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,9 @@ describe("requireBearerAuth middleware", () => {
95
95
token : "no-expiration-token" ,
96
96
clientId : "client-123" ,
97
97
scopes : [ "read" , "write" ] ,
98
- expiresAt
98
+
99
+ // Type does not accept possible undefined so an assertion is required for this test
100
+ expiresAt : expiresAt as number
99
101
} ;
100
102
mockVerifyAccessToken . mockResolvedValue ( noExpirationAuthInfo ) ;
101
103
@@ -146,6 +148,7 @@ describe("requireBearerAuth middleware", () => {
146
148
token : "valid-token" ,
147
149
clientId : "client-123" ,
148
150
scopes : [ "read" ] ,
151
+ expiresAt : Math . floor ( Date . now ( ) / 1000 ) + 3600 ,
149
152
} ;
150
153
mockVerifyAccessToken . mockResolvedValue ( authInfo ) ;
151
154
@@ -418,6 +421,7 @@ describe("requireBearerAuth middleware", () => {
418
421
token : "valid-token" ,
419
422
clientId : "client-123" ,
420
423
scopes : [ "read" ] ,
424
+ expiresAt : Math . floor ( Date . now ( ) / 1000 ) + 3600 ,
421
425
} ;
422
426
mockVerifyAccessToken . mockResolvedValue ( authInfo ) ;
423
427
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export interface AuthInfo {
20
20
/**
21
21
* When the token expires (in seconds since epoch).
22
22
*/
23
- expiresAt ? : number ;
23
+ expiresAt : number ;
24
24
25
25
/**
26
26
* The RFC 8707 resource server identifier for which this token is valid.
@@ -33,4 +33,4 @@ export interface AuthInfo {
33
33
* This field should be used for any additional data that needs to be attached to the auth info.
34
34
*/
35
35
extra ?: Record < string , unknown > ;
36
- }
36
+ }
You can’t perform that action at this time.
0 commit comments