summary refs log tree commit diff
path: root/synapse/handlers/auth.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-02-18 15:50:06 +0000
committerErik Johnston <erik@matrix.org>2020-02-18 16:11:26 +0000
commitbc936b56572aef4fc16fffaa44a75bfdf99eeec4 (patch)
tree8c4c030157dd4fa9df5a1d04dac76486327f9d7e /synapse/handlers/auth.py
parentMerge branch 'release-v1.10.0' into matrix-org-hotfixes (diff)
parentIncrease perf of `get_auth_chain_ids` used in state res v2. (#6937) (diff)
downloadsynapse-bc936b56572aef4fc16fffaa44a75bfdf99eeec4.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
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