Skip to content
Snippets Groups Projects
Commit 0722f982 authored by Erik Johnston's avatar Erik Johnston
Browse files

Disable registration if config option was set.

parent 81163f82
No related branches found
No related tags found
No related merge requests found
......@@ -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"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment