diff --git a/src/tmdsclient/client/oauth.py b/src/tmdsclient/client/oauth.py index b6ee5b3..76bbace 100644 --- a/src/tmdsclient/client/oauth.py +++ b/src/tmdsclient/client/oauth.py @@ -23,7 +23,7 @@ def token_is_valid(token: str) -> bool: try: decoded_token = jwt.decode(token, algorithms=["HS256"], options={"verify_signature": False}) expiration_timestamp = decoded_token.get("exp") - expiration_datetime = datetime.fromtimestamp(expiration_timestamp) + expiration_datetime = datetime.fromtimestamp(expiration_timestamp).replace(tzinfo=UTC) _logger.debug("Token is valid until %s", expiration_datetime.isoformat()) current_datetime = datetime.now(UTC) token_is_valid_one_minute_into_the_future = expiration_datetime > current_datetime + timedelta(minutes=1)