summary refs log tree commit diff
path: root/synapse/rest/client/v2_alpha/register.py
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2017-12-05 09:40:38 +0000
committerGitHub <noreply@github.com>2017-12-05 09:40:38 +0000
commitaa6ecf09846951bd822970ba2b6d7d38abeec0ff (patch)
treef675cc0f589fb974b529024ca3403be38f03a628 /synapse/rest/client/v2_alpha/register.py
parentMerge pull request #2716 from matrix-org/rav/federation_client_post (diff)
parentRefactor UI auth implementation (diff)
downloadsynapse-aa6ecf09846951bd822970ba2b6d7d38abeec0ff.tar.xz
Merge pull request #2727 from matrix-org/rav/refactor_ui_auth_return
Refactor UI auth implementation
Diffstat (limited to 'synapse/rest/client/v2_alpha/register.py')
-rw-r--r--synapse/rest/client/v2_alpha/register.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py
index 9e2f7308ce..e9d88a8895 100644
--- a/synapse/rest/client/v2_alpha/register.py
+++ b/synapse/rest/client/v2_alpha/register.py
@@ -27,7 +27,7 @@ from synapse.http.servlet import (
 )
 from synapse.util.msisdn import phone_number_to_msisdn
 
-from ._base import client_v2_patterns
+from ._base import client_v2_patterns, interactive_auth_handler
 
 import logging
 import hmac
@@ -176,6 +176,7 @@ class RegisterRestServlet(RestServlet):
         self.device_handler = hs.get_device_handler()
         self.macaroon_gen = hs.get_macaroon_generator()
 
+    @interactive_auth_handler
     @defer.inlineCallbacks
     def on_POST(self, request):
         yield run_on_reactor()
@@ -325,14 +326,10 @@ class RegisterRestServlet(RestServlet):
                     [LoginType.MSISDN, LoginType.EMAIL_IDENTITY],
                 ])
 
-        authed, auth_result, params, session_id = yield self.auth_handler.check_auth(
+        auth_result, params, session_id = yield self.auth_handler.check_auth(
             flows, body, self.hs.get_ip_from_request(request)
         )
 
-        if not authed:
-            defer.returnValue((401, auth_result))
-            return
-
         if registered_user_id is not None:
             logger.info(
                 "Already registered user ID %r for this session",