mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 07:55:55 +03:00
[PR #254] [MERGED] Fix oauth set token and fix unauthorized playback control #346
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#346
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/254
Author: @Rigellute
Created: 9/20/2021
Status: ✅ Merged
Merged: 9/20/2021
Merged by: @marioortizmanero
Base:
master← Head:master📝 Commits (4)
9ff89c4Fix auth token not being set properly09f5da4Fix unauthorized playback control4bb3906Revert "Fix auth token not being set properly"5527736Changeget_token_mutto return mutable reference to Option📊 Changes
5 files changed (+11 additions, -10 deletions)
View changed files
📝
src/auth_code.rs(+2 -2)📝
src/auth_code_pkce.rs(+2 -2)📝
src/client_creds.rs(+2 -2)📝
src/clients/base.rs(+1 -1)📝
src/clients/oauth.rs(+4 -3)📄 Description
Description
This PR fixes two issues:
prompt_for_tokenoauth flow was not loading the token after reading from the cache.start_context_playbackresulted in "request unauthorized"Motivation and Context
Regarding the first issue: Looks like the previous code was expecting the
String.replace()method to mutate the original string, butreplacecreates a new string. I've added a new method to explicitly set the token. Unless there's a more consitent way?For the second issue, the
start_context_playbackmethod was using the.putmethod and passingNonefor the headers, hence why all requests were unauthorized. I switched this to useendpoint_put, which appears to simply abstract the headers placement?Dependencies
None.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration
For the token cache issue, you can reproduce on master by
token_cached: trueFor the not authorized playback control issue:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.