summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-07-29 10:00:54 +0100
committerKegan Dougal <kegan@matrix.org>2015-07-29 10:00:54 +0100
commit11b0a3407485e98082bf06d771e5ae2f68106ca7 (patch)
tree86b2c435048843ffaddfca288a8984eff92b4fa2 /synapse
parentFix v2_alpha registration. Add unit tests. (diff)
downloadsynapse-11b0a3407485e98082bf06d771e5ae2f68106ca7.tar.xz
Use the same reg paths as register v1 for ASes.
Namely this means using registration_handler.appservice_register.
Diffstat (limited to 'synapse')
-rw-r--r--synapse/rest/client/v2_alpha/register.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py
index e1c42dd51e..cf54e1dacf 100644
--- a/synapse/rest/client/v2_alpha/register.py
+++ b/synapse/rest/client/v2_alpha/register.py
@@ -82,7 +82,9 @@ class RegisterRestServlet(RestServlet):
 
         # == Application Service Registration ==
         if appservice:
-            result = yield self._do_appservice_registration(desired_username)
+            result = yield self._do_appservice_registration(
+                desired_username, request.args["access_token"][0]
+            )
             defer.returnValue((200, result))  # we throw for non 200 responses
             return
 
@@ -166,9 +168,9 @@ class RegisterRestServlet(RestServlet):
         return 200, {}
 
     @defer.inlineCallbacks
-    def _do_appservice_registration(self, username):
-        (user_id, token) = yield self.registration_handler.register(
-            localpart=username
+    def _do_appservice_registration(self, username, as_token):
+        (user_id, token) = yield self.registration_handler.appservice_register(
+            username, as_token
         )
         defer.returnValue(self._create_registration_details(user_id, token))