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
{{ message }}
Repository navigation
Tesla.authorized doesn't detect a stale-but-present invalid token #178
This only tells you a token exists in the cache, not that it's still valid, so once cache.json holds any token, even one whose refresh_token has expired, authorized still returns True, fetch_token()/api() skip the interactive flow, and the first API call
instead falls into automatic token refresh, which fails with oauthlib.oauth2.rfc6749.errors.LoginRequired: (login_required) The refresh_token is invalid.
Feels like .authorized should do some kind of a check on this front, but doesn't feel like it would be lightweight.
Not sure what to suggest, but wanted to log it in case others encounter it.
changed the title [-]authorized (and the README's if not tesla.authorized pattern) doesn't detect a stale-but-present invalid token[/-][+]`Tesla.authorized` doesn't detect a stale-but-present invalid token[/+]on Jul 17, 2026
Activity
[-]authorized (and the README's if not tesla.authorized pattern) doesn't detect a stale-but-present invalid token[/-][+]`Tesla.authorized` doesn't detect a stale-but-present invalid token[/+]