summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-05-28 16:58:43 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2020-05-28 16:59:43 +0100
commitf457eedc8784ee5829b0320b8c3f0f63cd891100 (patch)
tree6beb27d1416abbe848714e9001b4762dc8605479
parentMerge branch 'master' into develop (diff)
downloadsynapse-github/anoa/legacy_login_medium.tar.xz
Require deprecated medium parameter to be 'email' github/anoa/legacy_login_medium anoa/legacy_login_medium
-rw-r--r--synapse/rest/client/v1/login.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/rest/client/v1/login.py b/synapse/rest/client/v1/login.py
index d89b2e5532..3957420dee 100644
--- a/synapse/rest/client/v1/login.py
+++ b/synapse/rest/client/v1/login.py
@@ -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"],