You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug is_token_expired() uses time.time() which returns system local time, which, when running on a non-UTC system, can return incorrectly.
Your code
token_info=auth_manager.cache_handler.get_cached_token()
print(f"Token expires_at: {token_info['expires_at']}")
print(f"Local Time (Pacific): {int(time.time())}")
print(f"UTC Time: {int(time.mktime(time.gmtime()))}")
# Token shows not expired, but it is expected that it is expiredprint(auth_manager.is_token_expired(token_info))
Token expires_at: 1669239147
Local Time (Pacific): 1669229727
UTC Time: 1669247727
False
Describe the bug
is_token_expired()
usestime.time()
which returns system local time, which, when running on a non-UTC system, can return incorrectly.Your code
Expected behavior
Replace
time.time()
with, e.g.,time.mktime(time.gmtime())
wherever used.Environment:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: