You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the same access token in getLastPlayed() generated by currently playing API call when there is no ongoing track. It does not make sense to regenerate a new token instead of using the existing one
The text was updated successfully, but these errors were encountered:
wouldnt it be ideal to add the access token to the class as a private property and refetch it when it expires since they expire after an hour? . would spare a couple of requests
Yes. That should be the ideal implementation. PRs are open for this!
It should ideally only generate access token once the api throws an expired accesstoken error which is probably 401 if I am not wrong
melosh101
added a commit
to melosh101/spotify-mini
that referenced
this issue
Mar 10, 2022
add caching of the accesToken to the client
add limit to the getLastPlayed function to allow the user to pick the amount of tracks to recieve. max being 50 and minimum being 1.
fixesrocktimsaikia#7fixesrocktimsaikia#10
spotify-mini/index.ts
Line 72 in 50bc8ec
Use the same access token in
getLastPlayed()
generated by currently playing API call when there is no ongoing track. It does not make sense to regenerate a new token instead of using the existing oneThe text was updated successfully, but these errors were encountered: