update requests_oauthlib

This commit is contained in:
AdeHub
2024-08-24 16:33:52 +12:00
parent aeebc67365
commit b3edfa0d87
16 changed files with 107 additions and 86 deletions
@@ -8,8 +8,6 @@ MissingTokenError.
from json import loads, dumps
from oauthlib.common import to_unicode
def fitbit_compliance_fix(session):
def _missing_error(r):
@@ -17,7 +15,7 @@ def fitbit_compliance_fix(session):
if "errors" in token:
# Set the error to the first one we have
token["error"] = token["errors"][0]["errorType"]
r._content = to_unicode(dumps(token)).encode("UTF-8")
r._content = dumps(token).encode()
return r
session.register_compliance_hook("access_token_response", _missing_error)