summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-02-20 11:39:53 +0000
committerErik Johnston <erik@matrix.org>2015-02-20 11:39:53 +0000
commit15e2d7e38762efbc9e9c706d4d2a63bb6fcfd541 (patch)
tree9d684e2f0e4dce58e295a0623392a29a5bd4a5e2 /synapse/rest
parentUpdate tests (diff)
downloadsynapse-15e2d7e38762efbc9e9c706d4d2a63bb6fcfd541.tar.xz
Always allow AS to register
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/client/v1/register.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/rest/client/v1/register.py b/synapse/rest/client/v1/register.py
index dba49129a9..f5acfb945f 100644
--- a/synapse/rest/client/v1/register.py
+++ b/synapse/rest/client/v1/register.py
@@ -98,9 +98,6 @@ class RegisterRestServlet(ClientV1RestServlet):
 
     @defer.inlineCallbacks
     def on_POST(self, request):
-        if self.disable_registration:
-            raise SynapseError(403, "Registration has been disabled")
-
         register_json = _parse_json(request)
 
         session = (register_json["session"]
@@ -111,6 +108,11 @@ class RegisterRestServlet(ClientV1RestServlet):
 
         try:
             login_type = register_json["type"]
+
+            is_application_server = login_type == LoginType.APPLICATION_SERVICE
+            if self.disable_registration and not is_application_server:
+                raise SynapseError(403, "Registration has been disabled")
+
             stages = {
                 LoginType.RECAPTCHA: self._do_recaptcha,
                 LoginType.PASSWORD: self._do_password,