Skip to content

Commit

Permalink
fix: IdTokenClient expiry_date check (#1555)
Browse files Browse the repository at this point in the history
to respect eagerRefreshThresholdMillis of parent class `OAuth2Client`

Co-authored-by: Daniel Bankhead <danielbankhead@google.com>
  • Loading branch information
AyushWalekar and danielbankhead authored Jun 6, 2023
1 parent e3ab824 commit efcdef1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/auth/idtokenclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export class IdTokenClient extends OAuth2Client {
): Promise<RequestMetadataResponse> {
if (
!this.credentials.id_token ||
(this.credentials.expiry_date || 0) < Date.now()
!this.credentials.expiry_date ||
this.isTokenExpiring()
) {
const idToken = await this.idTokenProvider.fetchIdToken(
this.targetAudience
Expand Down

0 comments on commit efcdef1

Please sign in to comment.