summary refs log tree commit diff
path: root/synapse/rest/register.py
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2014-09-23 15:16:47 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2014-09-23 15:16:47 +0100
commit5f16439752fa6ff9b452cac86fbbb07a12ae44f7 (patch)
tree718baf94cfb23755e5fce34097949948b5b00992 /synapse/rest/register.py
parentAllow a (hidden undocumented) key to m.login.recaptcha to specify a shared se... (diff)
downloadsynapse-5f16439752fa6ff9b452cac86fbbb07a12ae44f7.tar.xz
Make sure the config actually /has/ a captcha_bypass_secret set before trying to compare it
Diffstat (limited to 'synapse/rest/register.py')
-rw-r--r--synapse/rest/register.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/rest/register.py b/synapse/rest/register.py
index f1354e4b71..3b07a127a6 100644
--- a/synapse/rest/register.py
+++ b/synapse/rest/register.py
@@ -153,8 +153,9 @@ class RegisterRestServlet(RestServlet):
     @defer.inlineCallbacks
     def _check_recaptcha(self, request, register_json):
         if "captcha_bypass_secret" in register_json:
-            if (register_json["captcha_bypass_secret"] ==
-                    self.hs.config.captcha_bypass_secret):
+            if (self.hs.config.captcha_bypass_secret is not None and
+                    register_json["captcha_bypass_secret"] ==
+                        self.hs.config.captcha_bypass_secret):
                 defer.returnValue(None)
             else:
                 raise SynapseError(400, "Captcha bypass secret incorrect",