librespot-org / librespot

Open Source Spotify client library
MIT License
4.52k stars 544 forks source link

do not overwrite unchanged cached Credentials (#1168) #1187

Closed jokester closed 1 year ago

jokester commented 1 year ago

fixes #1168

jokester commented 1 year ago

This is my first time coding in a real rust project. I didn't even know Arc<T> before this day.

If something goes wrong I'm sorry :rofl:

roderickvd commented 1 year ago

Looks good to me, thanks!

Laiteux commented 10 months ago

@jokester @roderickvd this PR does not work. The logic is not correct and can't be correct anyway as the problem lies elsewhere.

The issue is that right now, no matter what, librespot will reconnect to your account every time you use Session::connect.

This is problematic because

  1. This might trigger stuff on Spotify's side
  2. Indeed, it does, as if done too many times, Spotify will force you a reset password

A token refresh if the current session dies would be the way. Still, the issue remains that the stored auth_data isn't being reused at all. Cached but never used.

oSumAtrIX commented 10 months ago

@Laiteux You may want to open a new issue, as this PR is closed and will unlikely get any attention from devs.