mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-19 17:56:19 +03:00
Require deprecated medium parameter to be 'email'
This commit is contained in:
parent
5cb470b495
commit
f457eedc87
1 changed files with 6 additions and 0 deletions
|
@ -43,6 +43,12 @@ def login_submission_legacy_convert(submission):
|
|||
del submission["user"]
|
||||
|
||||
if "medium" in submission and "address" in submission:
|
||||
# "email" is the only accepted medium type
|
||||
if submission["medium"] != "email":
|
||||
raise SynapseError(
|
||||
400, "'medium' parameter must be 'email'", errcode=Codes.INVALID_PARAM
|
||||
)
|
||||
|
||||
submission["identifier"] = {
|
||||
"type": "m.id.thirdparty",
|
||||
"medium": submission["medium"],
|
||||
|
|
Loading…
Reference in a new issue