mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:16:07 -04:00
Admin api to add an email address (#6789)
This commit is contained in:
parent
f4884444c3
commit
56ca93ef59
6 changed files with 78 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue