auth: Facebook now returns auth tokens in json instead of url-encoded

Fixes #1992
This commit is contained in:
Dayne Jones 2017-03-29 21:43:07 -04:00 committed by Ben Darnell
parent c0f99bac0a
commit 8bb8795216
2 changed files with 3 additions and 3 deletions

View File

@ -978,9 +978,9 @@ class FacebookGraphMixin(OAuth2Mixin):
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")
}

View File

@ -149,7 +149,7 @@ class FacebookClientLoginHandler(RequestHandler, FacebookGraphMixin):
class FacebookServerAccessTokenHandler(RequestHandler):
def get(self):
self.write('access_token=asdf')
self.write(dict(access_token="asdf"))
class FacebookServerMeHandler(RequestHandler):