summary refs log tree commit diff
path: root/synapse/rest/client/v1/register.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-02-23 14:36:00 +0000
committerErik Johnston <erik@matrix.org>2015-02-23 14:36:00 +0000
commite25e0f4da9ac04aab6bcaacef3d2950963f673da (patch)
tree4cfd61797f83c9ef7c6c3328faad52797560f313 /synapse/rest/client/v1/register.py
parentRevert get_auth_chain changes (diff)
parentMerge branch 'master' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-e25e0f4da9ac04aab6bcaacef3d2950963f673da.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into batched_get_pdu
Diffstat (limited to 'synapse/rest/client/v1/register.py')
-rw-r--r--synapse/rest/client/v1/register.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/rest/client/v1/register.py b/synapse/rest/client/v1/register.py
index 8d2115082b..f5acfb945f 100644
--- a/synapse/rest/client/v1/register.py
+++ b/synapse/rest/client/v1/register.py
@@ -59,6 +59,7 @@ class RegisterRestServlet(ClientV1RestServlet):
         # }
         # TODO: persistent storage
         self.sessions = {}
+        self.disable_registration = hs.config.disable_registration
 
     def on_GET(self, request):
         if self.hs.config.enable_registration_captcha:
@@ -107,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,