diff --git a/packages/aws-cdk/lib/api/aws-auth/provider-caching.ts b/packages/aws-cdk/lib/api/aws-auth/provider-caching.ts index f4461a7f706b2..77b7630230c22 100644 --- a/packages/aws-cdk/lib/api/aws-auth/provider-caching.ts +++ b/packages/aws-cdk/lib/api/aws-auth/provider-caching.ts @@ -15,7 +15,8 @@ export function makeCachingProvider(provider: AwsCredentialIdentityProvider): Aw return memoize( provider, credentialsAboutToExpire, - (token) => token.expiration !== undefined); + (token) => !!token.expiration, + ); } export function credentialsAboutToExpire(token: AwsCredentialIdentity) {