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
3232 ? 'client_secret_basic'
3333 : 'none' ;
3434
35+ const getCurrentDateInSeconds = ( ) => Math . floor ( Date . now ( ) / 1000 ) ;
36+
3537const calculateExpirationDate = ( expiresIn ?: number ) => {
3638 if ( ! expiresIn ) {
3739 return undefined ;
3840 }
3941
40- return Math . floor ( Date . now ( ) / 1000 ) + expiresIn ;
42+ return getCurrentDateInSeconds ( ) + expiresIn ;
4143} ;
4244const getWellKnownData = async ( ) => {
4345 const wellKnownUrl = new URL ( OIDC_CONF_FULL_WELL_KNOWN_URL ) ;
@@ -150,7 +152,7 @@ export const authOptions: AuthOptions = {
150152 } ;
151153 }
152154
153- const now = Math . floor ( Date . now ( ) / 1000 ) ;
155+ const now = getCurrentDateInSeconds ( ) ;
154156 if (
155157 typeof token . accessTokenExpiresAt === 'number' &&
156158 now < token . accessTokenExpiresAt
You can’t perform that action at this time.
0 commit comments