feat: improve Login5 authentication with token renewal

Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
2025-09-20 23:38:20 +07:00
parent 56dade95e7
commit 72dffca271
6 changed files with 214 additions and 140 deletions

View File

@@ -26,12 +26,15 @@ def test_with_stored_credentials():
token = token_provider.get("playlist-read")
print(f"✓ Successfully got playlist-read token: {token[:20]}...")
# Check if Login5 token is available
login5_token = session.get_login5_token()
if login5_token:
print(f"✓ Login5 token available: {login5_token[:20]}...")
else:
print("⚠ Login5 token not available")
# Test Login5 token by requesting a different scope
try:
login5_token = token_provider.get_token("user-read-email", "user-read-private")
if login5_token and login5_token.access_token:
print(f"✓ Login5 token available: {login5_token.access_token[:20]}...")
else:
print("⚠ Login5 token not available")
except Exception as login5_error:
print(f"⚠ Login5 token test failed: {login5_error}")
session.close()
return True