From d68271068dd7ab51138adbc699d67c334800e5c7 Mon Sep 17 00:00:00 2001 From: DevilXD <4180725+DevilXD@users.noreply.github.com> Date: Wed, 18 Sep 2024 22:04:02 +0200 Subject: [PATCH] Minor code simplification --- twitch.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/twitch.py b/twitch.py index 860402e..677d851 100644 --- a/twitch.py +++ b/twitch.py @@ -385,14 +385,13 @@ class _AuthState: "https://id.twitch.tv/oauth2/validate", headers={"Authorization": f"OAuth {self.access_token}"} ) as response: - status = response.status - if status == 401: + if response.status == 401: # the access token we have is invalid - clear the cookie and reauth logger.info("Restored session is invalid") assert client_info.CLIENT_URL.host is not None jar.clear_domain(client_info.CLIENT_URL.host) continue - elif status == 200: + elif response.status == 200: validate_response = await response.json() break else: