Skip to content

Commit

Permalink
Add token expiration check in Client class (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjaliaga authored Mar 29, 2024
1 parent 27b5881 commit 302ba04
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aioaquarea/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ def is_logged(self) -> bool:
if not self._access_token:
return False

# We don't have an expiration time, so we assume the token is valid
if not self._token_expiration:
return True

now = dt.datetime.now(tz=dt.timezone.utc)
return now < self._token_expiration

Expand Down

0 comments on commit 302ba04

Please sign in to comment.