Skip to content

Commit

Permalink
PRMDR-168
Browse files Browse the repository at this point in the history
Changing internal eror code to 500 from 400
  • Loading branch information
AlexHerbertNHS committed Oct 20, 2023
1 parent cc6485c commit 99c98ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lambdas/handlers/back_channel_logout_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down

0 comments on commit 99c98ac

Please sign in to comment.