diff options
author | Erik Johnston <erik@matrix.org> | 2015-02-19 14:22:20 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-02-19 14:22:20 +0000 |
commit | 0722f982d3b664e6e1c20c3853bb3742683aee88 (patch) | |
tree | fe31535fd1ea745c16f2cb8782f4ec4ed131e690 /synapse | |
parent | Add config option to disable registration. (diff) | |
download | synapse-0722f982d3b664e6e1c20c3853bb3742683aee88.tar.xz |
Disable registration if config option was set.
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/rest/client/v1/register.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/rest/client/v1/register.py b/synapse/rest/client/v1/register.py index 8d2115082b..dba49129a9 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: @@ -97,6 +98,9 @@ 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"] |