Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
SYN-395: Fix CAPTCHA, don't double decode json
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed May 28, 2015
1 parent 79e37a7 commit afbd3b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions synapse/handlers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def _check_recaptcha(self, authdict, clientip):
# 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,
Expand All @@ -198,7 +198,8 @@ def _check_recaptcha(self, authdict, clientip):
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)
Expand Down

0 comments on commit afbd3b2

Please sign in to comment.