-
-
Notifications
You must be signed in to change notification settings - Fork 166
Closed as not planned
Labels
Description
I was trying to get Client to auto-refresh the token, but stumbled upon a few issues:
Client.from_client_credentials(...).start()raisesAuthenticationError. The actual exception is raised insideself._client._http.validate, which can't handle the situation when bothtokenandself.tokenareNone. The fix is easy:
async def validate(self: twitchio.http.TwitchHTTP, *, token: str = None) -> dict:
if not token:
# add these two lines:
if self.token is None:
await self._generate_login()
token = self.token
- But even fixing that is not enough: for application tokens (generated by
_generate_login) the response of/oauth2/validatedoes not containloginoruser_id- whichWSConnection._connect(...)expects.