I don't have a proper dev environment set up and the documentation for Requests-OAuthlib is pretty lacking, so I'll just dump the stacktrace here in case I ever feel like looking into this.
TypeError: Expected bytes, unicode, or None; got <class 'oauthlib.oauth2.rfc6749.tokens.OAuth2Token'>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 528, in request
url, headers, data = self._client.add_token(
File "/usr/local/lib/python3.9/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 217, in add_token
raise TokenExpiredError()
oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/swablu/web.py", line 94, in get
if await self.auth(self._allow_auth_without_hacks):
File "/app/swablu/web.py", line 166, in auth
user = discord.get(API_BASE_URL + '/users/@me').json()
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 602, in get
return self.request("GET", url, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 554, in request
self.token_updater(token)
File "/app/swablu/web.py", line 113, in token_updater
self.set_cookie('oauth2_token', token)
File "/usr/local/lib/python3.9/site-packages/tornado/web.py", line 635, in set_cookie
value = escape.native_str(value)
File "/usr/local/lib/python3.9/site-packages/tornado/escape.py", line 228, in to_unicode
raise TypeError("Expected bytes, unicode, or None; got %r" % type(value))
TypeError: Expected bytes, unicode, or None; got <class 'oauthlib.oauth2.rfc6749.tokens.OAuth2Token'>
I don't have a proper dev environment set up and the documentation for Requests-OAuthlib is pretty lacking, so I'll just dump the stacktrace here in case I ever feel like looking into this.