univrsal/tuna

Spotify Troubles Maintaining Authorization in Windows

alexankitty opened this issue · 5 comments

Describe the bug
When putting in spotify authorization and generating tokens, the application is unable to perform a token refresh, and hitting ok or apply will cause the plugin to log out.

To Reproduce
Steps to reproduce the behavior:

  1. Go to tools
  2. Click Tuna Settings
  3. Click Spotify Tab
  4. Click open login page
  5. Follow normal authorization steps to grab code
  6. Paste code into Authentication code feel
  7. Click request token - the login will be performed successfully
  8. After this, clicking OK or Apply will cause the plugin to no longer be logged in and gray out the perform refresh - clicking perform refresh will do the same thing
  9. Clicking request token again will cause the plugin to throw back a message saying the authorization code is invalid.

Expected behavior
Log in to the spotify API should be maintained when saving settings or performing a token refresh (provided the refresh token isn't blocked for whatever reason)

Log
https://obsproject.com/logs/qiIFyW8sX_6F1tAY

Note: the websocket disconnects can be ignored as this stems from one of my overlays.

Additional context
This issue does not seem to be present in 1.5.2, however I'm unsure which version brought about this issue.

Just tried it, same results - authorization code is being invalidated and refreshing the token isn't working. I did use the installer version if that helps any.

Edit:
I tried the zip as well, and played around with it a bit. It looks like the OK and Apply buttons are no longer invalidating the login, however token refresh still seems to be b0rked.

Here's the response log
= 2021.09.18 05:46 =
{
"access_token": "REDACTED",
"expires_in": 3600,
"scope": "user-modify-playback-state user-read-playback-state user-read-currently-playing",
"token_type": "Bearer"
}

= 2021.09.18 05:46 =
{
"access_token": "REDACTED",
"expires_in": 3600,
"scope": "user-modify-playback-state user-read-playback-state user-read-currently-playing",
"token_type": "Bearer"
}

= 2021.09.18 05:48 =
{
"error": "invalid_grant",
"error_description": "Invalid authorization code"
}

= 2021.09.18 05:50 =
{
"error": "invalid_grant",
"error_description": "Invalid authorization code"
}

(last two are from trying to request another token on the same code after it invalidates)

and this is showing it's no longer logged in after performing the token refresh.
image

Okay so refreshing didn't work? It should now
https://github.com/univrsal/tuna/actions/runs/1248525954

Just tried the latest and working perfectly!

Nice