diff --git a/lambdas/handlers/back_channel_logout_handler.py b/lambdas/handlers/back_channel_logout_handler.py index 0a1f7f332..bfa6504f7 100644 --- a/lambdas/handlers/back_channel_logout_handler.py +++ b/lambdas/handlers/back_channel_logout_handler.py @@ -37,7 +37,7 @@ def logout_handler(token): except ClientError as e: logger.error(f"Error logging out user: {e}") return ApiGatewayResponse( - 400, """{ "error":"Internal error logging user out"}""", "POST" + 500, """{ "error":"Internal error logging user out"}""", "POST" ).create_api_gateway_response() except AuthorisationException as e: logger.error(f"error while decoding JWT: {e}") diff --git a/lambdas/tests/unit/handlers/test_back_channel_logout_handler.py b/lambdas/tests/unit/handlers/test_back_channel_logout_handler.py index 0f8b86446..912f82b4d 100644 --- a/lambdas/tests/unit/handlers/test_back_channel_logout_handler.py +++ b/lambdas/tests/unit/handlers/test_back_channel_logout_handler.py @@ -103,7 +103,7 @@ def test_back_channel_logout_handler_invalid_jwt_returns_400(mock_oidc_service, mock_oidc_service.asset_called_with(mock_token) -def test_back_channel_logout_handler_boto_error_returns_400(mocker, mock_oidc_service, monkeypatch): +def test_back_channel_logout_handler_boto_error_returns_500(mocker, mock_oidc_service, monkeypatch): monkeypatch.setenv("OIDC_CALLBACK_URL", "mock_url") monkeypatch.setenv("AUTH_DYNAMODB_NAME", "mock_dynamo_name") mock_token = "mock_token" @@ -118,7 +118,7 @@ def test_back_channel_logout_handler_boto_error_returns_400(mocker, mock_oidc_se ) expected = ApiGatewayResponse( - 400, """{ "error":"Internal error logging user out"}""", "POST" + 500, """{ "error":"Internal error logging user out"}""", "POST" ).create_api_gateway_response() actual = lambda_handler(build_event_from_token(mock_token), None)