mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 07:55:55 +03:00
[PR #252] [MERGED] Fixes cached tokens #344
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#344
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?
📋 Pull Request Information
Original PR: https://github.com/ramsayleung/rspotify/pull/252
Author: @marioortizmanero
Created: 9/19/2021
Status: ✅ Merged
Merged: 9/20/2021
Merged by: @ramsayleung
Base:
master← Head:fix-token-read📝 Commits (2)
854369cFix token reading with prompt utilityae30eaeFix docs📊 Changes
2 files changed (+23 additions, -10 deletions)
View changed files
📝
src/client_creds.rs(+6 -3)📝
src/clients/oauth.rs(+17 -7)📄 Description
Description
This fixes:
prompt_for_user, which failed whenread_token_cachereturned and error. The problem here is that we are expecting an error in case the cache file isn't found (FileNotFoundError). We just want to ignore it, but it used?, which caused an early return. So thematchexpression just acceptsOk(Some())now.read_token_cachefor OAuth clients didn't check the config. WhoopsI also updated the docs to make them more exhaustive.
Motivation and Context
This was caused by #250
Dependencies
None
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
If you remove all cached tokens in your main directory and try to run any example it won't work. Now it does. This is because
prompt_user_tokenreturnedFileNotFoundand propagated. For example try with:🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.