Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit de9fe23

Browse files
committed
Use assert_param_in_dict
1 parent 1876235 commit de9fe23

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

synapse/handlers/auth.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
UserDeactivatedError,
3737
)
3838
from synapse.api.ratelimiting import Ratelimiter
39+
from synapse.http.servlet import assert_params_in_dict
3940
from synapse.handlers.ui_auth import INTERACTIVE_AUTH_CHECKERS
4041
from synapse.handlers.ui_auth.checkers import UserInteractiveAuthChecker
4142
from synapse.http.server import finish_request
@@ -78,12 +79,7 @@ def client_dict_convert_legacy_fields_to_identifier(
7879

7980
# We've converted valid, legacy login submissions to an identifier. If the
8081
# dict still doesn't have an identifier, it's invalid
81-
if "identifier" not in submission:
82-
raise SynapseError(
83-
400,
84-
"Missing 'identifier' parameter in login submission",
85-
errcode=Codes.MISSING_PARAM,
86-
)
82+
assert_params_in_dict(submission, required=["identifier"])
8783

8884
# Ensure the identifier has a type
8985
if "type" not in submission["identifier"]:

0 commit comments

Comments
 (0)