@@ -1234,8 +1234,6 @@ class OAuthProviderImpl {
1234
1234
const accessTokenId = await generateTokenId ( accessToken ) ;
1235
1235
const refreshTokenId = await generateTokenId ( refreshToken ) ;
1236
1236
1237
- const now = Math . floor ( Date . now ( ) / 1000 ) ;
1238
-
1239
1237
// Define the access token TTL, may be updated by callback if provided
1240
1238
let accessTokenTTL = this . options . accessTokenTTL ! ;
1241
1239
@@ -1307,6 +1305,7 @@ class OAuthProviderImpl {
1307
1305
}
1308
1306
1309
1307
// Calculate the access token expiration time (after callback might have updated TTL)
1308
+ const now = Math . floor ( Date . now ( ) / 1000 ) ;
1310
1309
const accessTokenExpiresAt = now + accessTokenTTL ;
1311
1310
1312
1311
// Wrap the keys for the new tokens
@@ -1441,8 +1440,6 @@ class OAuthProviderImpl {
1441
1440
const newRefreshToken = `${ userId } :${ grantId } :${ refreshTokenSecret } ` ;
1442
1441
const newRefreshTokenId = await generateTokenId ( newRefreshToken ) ;
1443
1442
1444
- const now = Math . floor ( Date . now ( ) / 1000 ) ;
1445
-
1446
1443
// Define the access token TTL, may be updated by callback if provided
1447
1444
let accessTokenTTL = this . options . accessTokenTTL ! ;
1448
1445
@@ -1534,6 +1531,7 @@ class OAuthProviderImpl {
1534
1531
}
1535
1532
1536
1533
// Calculate the access token expiration time (after callback might have updated TTL)
1534
+ const now = Math . floor ( Date . now ( ) / 1000 ) ;
1537
1535
const accessTokenExpiresAt = now + accessTokenTTL ;
1538
1536
1539
1537
// Wrap the key for both the new access token and refresh token
0 commit comments