Open klingtnet opened 3 years ago
We could reduce the frequency of these emails by trying to use the token, instead of just the username and password every time spot is opened. I will look into it.
Relevant auto-login code:
This however might be impossible with librespot, I'm not entirely sure.
Yes, that was my original intent when storing the token along with username/password but AFAICT it is not possible to authenticate with that token in librespot. But I might have missed something -- afterall it's librespot that gives us this token... hm...
Oh and also -- the mails stop coming after a while, don't know why ;p
Yes, that was my original intent when storing the token along with username/password but AFAICT it is not possible to authenticate with that token in librespot. But I might have missed something -- afterall it's librespot that gives us this token... hm...
Hmmm, this is in the code for sure...
https://github.com/librespot-org/librespot/blob/master/protocol/proto/authentication.proto#L25
Though it doesn't say anything about how to use it on the docs....
https://github.com/librespot-org/librespot/blob/master/docs/authentication.md
This still happens for me, I built from source from master a couple of days ago. Do I have to change something?
@nn1ks's patch should make it less frequent, but it might still happen and I don't think there is much else we can do :/ (I had not received any mail in a long while but I just had one today after Spotify's asked me to confirm my email)
Hmm. I'm switching between Spot and Psst, maybe that's the reason why I get them daily. Thanks anyway
Actually maybe Psst handles login better, doesn't seem to trigger emails! :thinking:
To clarify: My patch uses the access token which is only valid for one hour. So if you close Spot it could take anywhere between 0 and 60 minutes until the token is expired (depending on when it was last refreshed) and if it is expired you will still get an email the next time you open Spot.
I think a solution to this could be to use the "Authorization Code Flow" which in addition to an access token also returns a refresh token that is valid until it is manually revoked. The refresh token can then be used to request a new access token if it is expired. (spotify-tui also uses this authentication method)
I don't know about spotify-tui, but I doubt Psst does the same -- it also goes through the undocumented Spotify endpoints that librespot uses to allow login in without opening a web browser. And yet it seems to work a bit better... I should have a closer look!
Describe the bug
Opening spot triggers a "New login to Spotify" email.
To Reproduce Steps to reproduce the behavior:
Expected behavior
It should reuse its session or follow what the official client does.
General information:
0.1.10