From 15e2d7e38762efbc9e9c706d4d2a63bb6fcfd541 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 20 Feb 2015 11:39:53 +0000 Subject: [PATCH] Always allow AS to register --- synapse/rest/client/v1/register.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/synapse/rest/client/v1/register.py b/synapse/rest/client/v1/register.py index dba49129a..f5acfb945 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,