fix tidal auth issue on restart
This commit is contained in:
parent
56222b799a
commit
622e95e4df
1 changed files with 10 additions and 4 deletions
|
|
@ -475,10 +475,16 @@ class TidalClient:
|
|||
return True
|
||||
|
||||
def is_authenticated(self):
|
||||
"""Check if client is authenticated"""
|
||||
# Don't trigger authentication automatically here, just check token status
|
||||
return (self.access_token is not None and
|
||||
time.time() < self.token_expires_at)
|
||||
"""Check if client is authenticated, refreshing expired tokens if possible"""
|
||||
if self.access_token and time.time() < self.token_expires_at:
|
||||
return True
|
||||
|
||||
# Token expired but refresh token available — try silent refresh
|
||||
if self.access_token and self.refresh_token:
|
||||
logger.info("Tidal access token expired — attempting silent refresh...")
|
||||
return self._refresh_access_token()
|
||||
|
||||
return False
|
||||
|
||||
def _get_user_id(self):
|
||||
"""Get current user's ID from /users/me endpoint"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue