Minor code simplification

This commit is contained in:
DevilXD committed 2024-09-18 22:04:02 +02:00
1 parent cc7c4c1ab9
commit d68271068d
1 file changed
+2 -3
+2 -3
View File
@@ -385,14 +385,13 @@ class _AuthState:
"https://id.twitch.tv/oauth2/validate", "https://id.twitch.tv/oauth2/validate",
headers={"Authorization": f"OAuth {self.access_token}"} headers={"Authorization": f"OAuth {self.access_token}"}
) as response: ) as response:
status = response.status if response.status == 401:
if status == 401:
# the access token we have is invalid - clear the cookie and reauth # the access token we have is invalid - clear the cookie and reauth
logger.info("Restored session is invalid") logger.info("Restored session is invalid")
assert client_info.CLIENT_URL.host is not None assert client_info.CLIENT_URL.host is not None
jar.clear_domain(client_info.CLIENT_URL.host) jar.clear_domain(client_info.CLIENT_URL.host)
continue continue
elif status == 200: elif response.status == 200:
validate_response = await response.json() validate_response = await response.json()
break break
else: else: