mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[PR #509] [MERGED] Check the state #920
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#920
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/spotipy-dev/spotipy/pull/509
Author: @foobuzz
Created: 6/6/2020
Status: ✅ Merged
Merged: 6/20/2020
Merged by: @stephanebruckert
Base:
master← Head:verify-state📝 Commits (3)
550be31- Verify that the state received alongside the authorization code is consistent with the one sent3af70ffResurrect public methods parse_response_code and get_authorization_code559e8e8Use new method parse_oatuh_response_url for parse_response_code implementation.📊 Changes
3 files changed (+75 additions, -20 deletions)
View changed files
📝
spotipy/oauth2.py(+32 -19)📝
spotipy/util.py(+2 -0)📝
tests/unit/test_oauth.py(+41 -1)📄 Description
Hello,
The
SpotifyOAuthclass accepts an optionalstateparameter to be added to the authorization URL. However, this parameter wasn't checked when echoed back upon the redirection from Spotify, which pretty much made its usage useless. This PR simply adds the necessary check whenstateis used. I also refactored the extraction of the authentication code from the URL so that it's the same between interactive way and local server way.stateto be given toutil.prompt_for_user_token🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.