mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #545] Using app.py in the Examples Directory cause problem. #326
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#326
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?
Originally created by @AbhayAysola on GitHub (Jul 23, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/545
Describe the bug
I used
SET SPOTIPY_REDIRECT_URI=http://localhost:8888/And I also set the same uri in the developer dashboard settings with no discrepancies.
The port of my flask app is 8888.
When I run my code and open the uri
http://127.0.0.1:8888/the sign in button is visible.But when I click on the button it opens the Spotify Auth uri in another tab and the tab does not fully load. It opens another Spotify Auth tab again and again until I shut down the server.
I expect this to be a problem on my part as I am new to Oauth2 but I've been searching for a fix with no avail.
Your code
My code is the same as the app.py with an adjustment. The client id, secret and the redirect url are ENV variables.
I added this line to the end
if __name__ == '__main__': app.run(port=8888)At the time of running I wouldn't know the username of the user and I am unsure of how to implement a cache system so I set
check_cache=Falsein theoauth2.pyfile.Expected behavior
The normal auth procedure.
Output
@stephanebruckert commented on GitHub (Jul 23, 2020):
@AbhayAysola we should be merging a fix for that soon, but you can already use the code that is there https://github.com/plamere/spotipy/pull/539
@AbhayAysola commented on GitHub (Jul 24, 2020):
Thank you. It worked perfectly. I'm glad it's not a rookie mistake from my side.