0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-14 10:03:47 +01:00

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

This commit is contained in:
Paul "LeoNerd" Evans 2014-09-23 15:16:47 +01:00
parent 3a8a94448a
commit 5f16439752

View file

@ -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",