Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit efcdef1

Browse files
AyushWalekard-goog
andauthored
fix: IdTokenClient expiry_date check (#1555)
to respect eagerRefreshThresholdMillis of parent class `OAuth2Client` Co-authored-by: Daniel Bankhead <[email protected]>
1 parent e3ab824 commit efcdef1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/auth/idtokenclient.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ export class IdTokenClient extends OAuth2Client {
5252
): Promise<RequestMetadataResponse> {
5353
if (
5454
!this.credentials.id_token ||
55-
(this.credentials.expiry_date || 0) < Date.now()
55+
!this.credentials.expiry_date ||
56+
this.isTokenExpiring()
5657
) {
5758
const idToken = await this.idTokenProvider.fetchIdToken(
5859
this.targetAudience

0 commit comments

Comments
 (0)