summary refs log tree commit diff
path: root/synapse/handlers/auth.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-03-23 17:10:32 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-03-23 17:10:32 +0000
commit3b0ce55bf7f43f41a33cefd657dd731f1de7d3c4 (patch)
treeef67907f5bde30eaba755c260353bb6c73d47312 /synapse/handlers/auth.py
parentremove unused room_version_to_event_format (#6857) (diff)
parentAdmin api to add an email address (#6789) (diff)
downloadsynapse-3b0ce55bf7f43f41a33cefd657dd731f1de7d3c4.tar.xz
Admin api to add an email address (#6789)
* commit '56ca93ef5':
  Admin api to add an email address (#6789)
Diffstat (limited to 'synapse/handlers/auth.py')
-rw-r--r--synapse/handlers/auth.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py

index 54a71c49d2..48a88d3c2a 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py
@@ -816,6 +816,14 @@ class AuthHandler(BaseHandler): @defer.inlineCallbacks def add_threepid(self, user_id, medium, address, validated_at): + # check if medium has a valid value + if medium not in ["email", "msisdn"]: + raise SynapseError( + code=400, + msg=("'%s' is not a valid value for 'medium'" % (medium,)), + errcode=Codes.INVALID_PARAM, + ) + # 'Canonicalise' email addresses down to lower case. # We've now moving towards the homeserver being the entity that # is responsible for validating threepids used for resetting passwords