for the longest time i had an issue where i couldnt get past the login screen when i ran the app or i would run into a INVALID_CLIENT: Invalid redirect URI error.
the issue is clearly with the redirect URI
but the problem was that i had used localhost throughout my codebase and then in the spotify developer settings for the app i had used 127.0.0.1 because using localhost was deprecated after a certain point
but your codebase and the set redirect URIs have to be an exact match.
so update your codebase to also use 127.0.0.1 .
you also need to visit http://127.0.0.1:3000 instead of using http://localhost:3000.
update localhost —> 127.0.0.1
https://github.com/julia7hk/spotify/commit/main
steps to run:
- flask server
(venv) ➜ spotify git:(main) ✗ python3 main.py
* Serving Flask app 'main'
* Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
*** Running on http://127.0.0.1:5001**
Press CTRL+C to quit
* Restarting with stat
* Debugger is active!
* Debugger PIN: 192-494-816
- next.js
➜ spotify git:(main) ✗ npm run dev
> spotify@0.1.0 dev
> next dev
▲ Next.js 15.3.2
- Local: http://localhost:3000
- Network: http://10.186.174.37:3000
- Environments: .env
✓ Starting...
✓ Ready in 1079ms
! but go to http://127.0.0.1:3000 instead

yay i can see the ui now!!
new ui work

