diff --git a/twitchio/client.py b/twitchio/client.py index a07b2c82..18a7137e 100644 --- a/twitchio/client.py +++ b/twitchio/client.py @@ -310,6 +310,12 @@ async def login(self, *, token: str | None = None, load_tokens: bool = True, sav self._login_called = True self._save_tokens = save_tokens + if not self._http.client_id: + raise RuntimeError('Expected a valid "client_id", instead received: %s', self._http.client_id) + + if not token and not self._http.client_secret: + raise RuntimeError('Expected a valid "client_secret", instead received: %s', self._http.client_secret) + if not token: payload: ClientCredentialsPayload = await self._http.client_credentials_token() validated: ValidateTokenPayload = await self._http.validate_token(payload.access_token)