auth_code_pkce: add from_token_with_config() constructor #512
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add
AuthCodePkceSpotify::from_token_with_config()
Motivation and Context
This is required to be able to refresh an expired token from the cache as we need the client ID to refresh the token.
Fix #511
Dependencies
None
Type of change
Please delete options that are not relevant.
How has this been tested?
AuthCodePkceSpotify
usingwith_config()
andToken::from_cache()
and check thattoken.is_expired()
returnstrue
.AuthCodePkceSpotify::from_token()
and then callclient.refresh_token()
. The client won't work as the token has not been refresh. You can also check by callingclient.refetch_token()
as it returnsNone
.AuthCodePkceSpotify::from_token_with_config()
passing the properCredentials
.client.refresh_token()
andclient.refetch_token()
are now working.Is this change properly documented?
Yes.