2 from oauthlib.common import urldecode
5 def facebook_compliance_fix(session):
7 def _compliance_fix(r):
8 token = dict(urldecode(r.text))
9 expires = token.get('expires')
10 if expires is not None:
11 token['expires_in'] = expires
12 token['token_type'] = 'Bearer'
13 r._content = dumps(token)
16 session.register_compliance_hook('access_token_response', _compliance_fix)