summary refs log tree commit diff
diff options
context:
space:
mode:
-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"],