-
-
Notifications
You must be signed in to change notification settings - Fork 37
Description
While looking into Issue #71, I ran into a new issue after revoking the app's access from Spotify Account -> Manage Apps (https://www.spotify.com/ca-en/account/apps/).
What happens here is that the refresh token is revoked, but the package doesn't handle this error which leads to a negative UX when the user wants to sign in again and naturally, the API calls will be running into errors. The access token, however, remains valid till it expires.
Encountered with AuthCodeFlowManager (proxy and client), untested with other auth methods.
Log Trace
[spotifyDecode: trace: decodeSpotifyErrors(data:httpURLResponse:) line 67] will try to decode data from URL 'https://accounts.spotify.com/api/token' into error objects:
{"error":"invalid_grant","error_description":"Refresh token revoked"}
refresh tokens completion: failure(SpotifyWebAPI.SpotifyAuthenticationError(error: "invalid_grant", errorDescription: Optional("Refresh token revoked")))
Steps to reproduce
- Authorize Spotify
- Go to https://www.spotify.com/ca-en/account/apps/ and remove the app's access
- Attempt to refresh the token
This will also be reflected when restarting the app and seeing the log out button instead of sign in when token has expired