diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2019-11-29 13:51:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-29 13:51:14 +0000 |
commit | 23ea5721259059d50b80083bb7240a8cb56cf297 (patch) | |
tree | ce19c112095f6b2a5df04e07eafc7b6598ff6f45 /synapse/rest/client/v2_alpha | |
parent | Merge pull request #6434 from matrix-org/erikj/msc2367_membership_reasons (diff) | |
download | synapse-23ea5721259059d50b80083bb7240a8cb56cf297.tar.xz |
Add User-Interactive Auth to /account/3pid/add (#6119)
Diffstat (limited to 'synapse/rest/client/v2_alpha')
-rw-r--r-- | synapse/rest/client/v2_alpha/account.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/rest/client/v2_alpha/account.py b/synapse/rest/client/v2_alpha/account.py index f26eae794c..ad674239ab 100644 --- a/synapse/rest/client/v2_alpha/account.py +++ b/synapse/rest/client/v2_alpha/account.py @@ -642,6 +642,7 @@ class ThreepidAddRestServlet(RestServlet): self.auth = hs.get_auth() self.auth_handler = hs.get_auth_handler() + @interactive_auth_handler @defer.inlineCallbacks def on_POST(self, request): requester = yield self.auth.get_user_by_req(request) @@ -652,6 +653,10 @@ class ThreepidAddRestServlet(RestServlet): client_secret = body["client_secret"] sid = body["sid"] + yield self.auth_handler.validate_user_via_ui_auth( + requester, body, self.hs.get_ip_from_request(request) + ) + validation_session = yield self.identity_handler.validate_threepid_session( client_secret, sid ) |