diff options
author | Andrew Morgan <andrew@amorgan.xyz> | 2019-09-10 15:57:32 +0100 |
---|---|---|
committer | Andrew Morgan <andrew@amorgan.xyz> | 2019-09-10 17:56:10 +0100 |
commit | 60d3c57bd0c977cbe6b7585a2c1517cc4e2c16dd (patch) | |
tree | cb383410ea384a21f5a993389c82166d971b5fa8 /synapse/handlers/auth.py | |
parent | Merge pull request #5993 from matrix-org/anoa/worker_store_reg (diff) | |
download | synapse-60d3c57bd0c977cbe6b7585a2c1517cc4e2c16dd.tar.xz |
Use account_threepid_delegate for 3pid validation
Diffstat (limited to 'synapse/handlers/auth.py')
-rw-r--r-- | synapse/handlers/auth.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py index d0c0142740..374372b69e 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py @@ -444,7 +444,16 @@ class AuthHandler(BaseHandler): logger.info("Getting validated threepid. threepidcreds: %r", (threepid_creds,)) if self.hs.config.threepid_behaviour_email == ThreepidBehaviour.REMOTE: - threepid = yield identity_handler.threepid_from_creds(threepid_creds) + if medium == "email": + threepid = yield identity_handler.threepid_from_creds( + self.hs.config.account_threepid_delegate_email, threepid_creds + ) + elif medium == "msisdn": + threepid = yield identity_handler.threepid_from_creds( + self.hs.config.account_threepid_delegate_msisdn, threepid_creds + ) + else: + raise SynapseError(400, "Unrecognized threepid medium: %s" % (medium,)) elif self.hs.config.threepid_behaviour_email == ThreepidBehaviour.LOCAL: row = yield self.store.get_threepid_validation_session( medium, |