mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 07:55:55 +03:00
[GH-ISSUE #96] Disable token caching #28
Labels
No labels
Stale
bug
discussion
enhancement
good first issue
good first issue
help wanted
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/rspotify#28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @raffomania on GitHub (May 27, 2020).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/96
I'm writing a web app for multiple users and would like to save the API token in my database. Is there a way to prevent
.spotify_token_cache.jsonfrom being created?@ramsayleung commented on GitHub (May 28, 2020):
.spotify_token_cache.jsonis the default way to cache the token, there is no way to prevent to create.spotify_token_cache.jsonnow :(My intution is to add a option of
SpotifyOAuth, for exampledisable_cache,to prevent
rspotifyfrom generating.spotify_token_cache.jsonwhich is enable by default.@raffomania commented on GitHub (Jun 3, 2020):
that option would be awesome!
@ramsayleung commented on GitHub (Jun 4, 2020):
I have completed this feature by adding two separate functions to get access token and refresh token without saving token into
cache_pathinstead of adding a new option to disable cache. I think the current choice leads to less change of the codebase. If you want to know how to use the two new functions, check this example for more details :)github.com/ramsayleung/rspotify@92984d2bcc/examples/get_access_token_without_cache.rs (L22)github.com/ramsayleung/rspotify@92984d2bcc/examples/get_access_token_without_cache.rs (L43)@raffomania commented on GitHub (Jun 5, 2020):
alright, seems like a larger API surface, but it solves my problem so I'm happy :)
Thanks a lot for making this crate and for the quick reply! <3
@ramsayleung commented on GitHub (Jun 5, 2020):
Thanks for your response, I am going to close this issue :)