mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 07:55:55 +03:00
[PR #263] [MERGED] Refresh fixes #355
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#355
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/263
Author: @marioortizmanero
Created: 10/10/2021
Status: ✅ Merged
Merged: 10/11/2021
Merged by: @ramsayleung
Base:
ramsay_support_refresh_token_v2← Head:refresh-fixes📝 Commits (9)
b864aa9New test and improved threading oned51824eFix stack overflowa314b6eImprove the with_auto_reauth exampled880302Finally fix the example!7151603Fix docs8db2f8fFix testsca6943aMove get_token to the traite96bc56Fix expiring testfb98bc0Only reauth when performing a request📊 Changes
12 files changed (+178 additions, -161 deletions)
View changed files
📝
Cargo.toml(+5 -0)➕
examples/tasks.rs(+44 -0)📝
examples/ureq/threading.rs(+3 -4)📝
examples/with_auto_reauth.rs(+58 -48)📝
rspotify-model/src/auth.rs(+5 -8)📝
src/auth_code.rs(+1 -6)📝
src/auth_code_pkce.rs(+2 -9)📝
src/client_creds.rs(+2 -38)📝
src/clients/base.rs(+43 -21)📝
src/clients/oauth.rs(+1 -21)📝
src/lib.rs(+1 -2)📝
tests/test_oauth2.rs(+13 -4)📄 Description
Description
Some fixes for #262:
examples/with_auto_reauth.rsexampleauto_reauthandrefresh_tokento the trait, since we already haverefetch_tokenavailable.auto_reauthis only called once, and we can avoid having two token getters (one that refreshes and another that doesn't).Token::is_expirednow includes a margin of 10 secondsToken::can_reauthwas wrong: it checked ifrefresh_tokenwasSome(), but that's not true in the case of client credentials.Motivation and Context
See #262
Dependencies
None
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
You can run the new test with:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.