From f457eedc8784ee5829b0320b8c3f0f63cd891100 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 28 May 2020 16:58:43 +0100 Subject: [PATCH] Require deprecated medium parameter to be 'email' --- synapse/rest/client/v1/login.py | 6 ++++++ 1 file changed, 6 insertions(+) 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"],