Skip to content

Commit

Permalink
auth: Facebook now returns auth tokens in json instead of url-encoded
Browse files Browse the repository at this point in the history
Fixes #1992
  • Loading branch information
daynejones authored and bdarnell committed Mar 30, 2017
1 parent c0f99ba commit 8bb8795
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tornado/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -978,9 +978,9 @@ def _on_access_token(self, redirect_uri, client_id, client_secret,
future.set_exception(AuthError('Facebook auth error: %s' % str(response)))
return

args = urlparse.parse_qs(escape.native_str(response.body))
args = escape.json_decode(response.body)
session = {
"access_token": args["access_token"][-1],
"access_token": args.get("access_token"),
"expires": args.get("expires")
}

Expand Down
2 changes: 1 addition & 1 deletion tornado/test/auth_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def get(self):

class FacebookServerAccessTokenHandler(RequestHandler):
def get(self):
self.write('access_token=asdf')
self.write(dict(access_token="asdf"))


class FacebookServerMeHandler(RequestHandler):
Expand Down

0 comments on commit 8bb8795

Please sign in to comment.