summary refs log tree commit diff
path: root/synapse/handlers/auth.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-05-29 09:57:43 +0100
committerErik Johnston <erik@matrix.org>2015-05-29 09:57:43 +0100
commit06c4124f8ecbc70cbf21a351b4af32b87cc516f2 (patch)
tree0a6a78f5e32d54012545f3745525c5be29589182 /synapse/handlers/auth.py
parentUse pyinstrument (diff)
parentSYN-395: Fix CAPTCHA, don't double decode json (diff)
downloadsynapse-06c4124f8ecbc70cbf21a351b4af32b87cc516f2.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/profile_rununtilconcurrent
Diffstat (limited to 'synapse/handlers/auth.py')
-rw-r--r--synapse/handlers/auth.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py

index 4e2e50345e..0cc28248a9 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py
@@ -187,7 +187,7 @@ class AuthHandler(BaseHandler): # each request try: client = SimpleHttpClient(self.hs) - data = yield client.post_urlencoded_get_json( + resp_body = yield client.post_urlencoded_get_json( "https://www.google.com/recaptcha/api/siteverify", args={ 'secret': self.hs.config.recaptcha_private_key, @@ -198,7 +198,8 @@ class AuthHandler(BaseHandler): except PartialDownloadError as pde: # Twisted is silly data = pde.response - resp_body = simplejson.loads(data) + resp_body = simplejson.loads(data) + if 'success' in resp_body and resp_body['success']: defer.returnValue(True) raise LoginError(401, "", errcode=Codes.UNAUTHORIZED)