File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -32,12 +32,14 @@ const token_endpoint_auth_method = OAUTH2_CLIENT_SECRET
32
32
? 'client_secret_basic'
33
33
: 'none' ;
34
34
35
+ const getCurrentDateInSeconds = ( ) => Math . floor ( Date . now ( ) / 1000 ) ;
36
+
35
37
const calculateExpirationDate = ( expiresIn ?: number ) => {
36
38
if ( ! expiresIn ) {
37
39
return undefined ;
38
40
}
39
41
40
- return Math . floor ( Date . now ( ) / 1000 ) + expiresIn ;
42
+ return getCurrentDateInSeconds ( ) + expiresIn ;
41
43
} ;
42
44
const getWellKnownData = async ( ) => {
43
45
const wellKnownUrl = new URL ( OIDC_CONF_FULL_WELL_KNOWN_URL ) ;
@@ -150,7 +152,7 @@ export const authOptions: AuthOptions = {
150
152
} ;
151
153
}
152
154
153
- const now = Math . floor ( Date . now ( ) / 1000 ) ;
155
+ const now = getCurrentDateInSeconds ( ) ;
154
156
if (
155
157
typeof token . accessTokenExpiresAt === 'number' &&
156
158
now < token . accessTokenExpiresAt
You can’t perform that action at this time.
0 commit comments