Skip to content

Commit

Permalink
Minor code simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
DevilXD committed Sep 18, 2024
1 parent cc7c4c1 commit d682710
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,13 @@ async def _validate(self):
"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:
Expand Down

0 comments on commit d682710

Please sign in to comment.