summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-06-16 11:10:34 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2020-06-16 11:33:13 +0100
commitb8f4b0c27c1ed2b7d1b429e69985afb6ee4b8b7f (patch)
tree4c65b04c633594b58414cd1337968cdbe7249c71
parentpop() instead of pull then del (diff)
downloadsynapse-b8f4b0c27c1ed2b7d1b429e69985afb6ee4b8b7f.tar.xz
Use assert_param_in_dict
-rw-r--r--synapse/handlers/auth.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py

index 57dead89b5..fd4e4148e3 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py
@@ -39,6 +39,7 @@ from synapse.api.ratelimiting import Ratelimiter from synapse.handlers.ui_auth import INTERACTIVE_AUTH_CHECKERS from synapse.handlers.ui_auth.checkers import UserInteractiveAuthChecker from synapse.http.server import finish_request +from synapse.http.servlet import assert_params_in_dict from synapse.http.site import SynapseRequest from synapse.logging.context import defer_to_thread from synapse.metrics.background_process_metrics import run_as_background_process @@ -78,12 +79,7 @@ def client_dict_convert_legacy_fields_to_identifier( # We've converted valid, legacy login submissions to an identifier. If the # dict still doesn't have an identifier, it's invalid - if "identifier" not in submission: - raise SynapseError( - 400, - "Missing 'identifier' parameter in login submission", - errcode=Codes.MISSING_PARAM, - ) + assert_params_in_dict(submission, required=["identifier"]) # Ensure the identifier has a type if "type" not in submission["identifier"]: