Skip to content
Snippets Groups Projects
Commit 5f164397 authored by Paul "LeoNerd" Evans's avatar Paul "LeoNerd" Evans
Browse files

Make sure the config actually /has/ a captcha_bypass_secret set before trying to compare it

parent 3a8a9444
No related branches found
No related tags found
No related merge requests found
...@@ -153,8 +153,9 @@ class RegisterRestServlet(RestServlet): ...@@ -153,8 +153,9 @@ class RegisterRestServlet(RestServlet):
@defer.inlineCallbacks @defer.inlineCallbacks
def _check_recaptcha(self, request, register_json): def _check_recaptcha(self, request, register_json):
if "captcha_bypass_secret" in register_json: if "captcha_bypass_secret" in register_json:
if (register_json["captcha_bypass_secret"] == if (self.hs.config.captcha_bypass_secret is not None and
self.hs.config.captcha_bypass_secret): register_json["captcha_bypass_secret"] ==
self.hs.config.captcha_bypass_secret):
defer.returnValue(None) defer.returnValue(None)
else: else:
raise SynapseError(400, "Captcha bypass secret incorrect", raise SynapseError(400, "Captcha bypass secret incorrect",
......
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