diff --git a/deploy/stacks/cognito.py b/deploy/stacks/cognito.py index ed18225fc..f9e89f17c 100644 --- a/deploy/stacks/cognito.py +++ b/deploy/stacks/cognito.py @@ -100,7 +100,7 @@ def __init__( domain_prefix=f"{resource_prefix.replace('-', '')}{envname}{self.region.replace('-', '')}{self.account}" ), ) - id_token_duration = 180 if with_approval_tests else 60 + jwt_token_duration = 180 if with_approval_tests else 60 self.client = cognito.UserPoolClient( self, f'AppClient-{envname}', @@ -108,7 +108,8 @@ def __init__( auth_flows=AuthFlow(user_password=with_approval_tests, user_srp=True, custom=True), prevent_user_existence_errors=True, refresh_token_validity=Duration.minutes(cognito_user_session_timeout_inmins), - id_token_validity=Duration.minutes(id_token_duration), + id_token_validity=Duration.minutes(jwt_token_duration), + access_token_validity=Duration.minutes(jwt_token_duration), ) if enable_cw_rum: