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 22e4b357e191d..766e92d08b864 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) {