From c973cd2f38bf305c4f08cebdf361fdd08e434fa2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 13 Nov 2025 13:46:33 +0000 Subject: [PATCH 1/2] Initial plan From b7e44aef1816b010a2c60be88a37dcfb8c971ccf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 13 Nov 2025 13:52:51 +0000 Subject: [PATCH 2/2] Add configurable redirect URI field to fix INVALID_CLIENT error Co-authored-by: raphaelbleier <75416341+raphaelbleier@users.noreply.github.com> --- app/routes/web.py | 3 +++ app/templates/index.html | 9 +++++++++ tests/test_config.py | 11 +++++++++++ 3 files changed, 23 insertions(+) diff --git a/app/routes/web.py b/app/routes/web.py index 1f046ad..2516c1c 100644 --- a/app/routes/web.py +++ b/app/routes/web.py @@ -30,6 +30,7 @@ def index(): color_method=status.get('color_extraction_method', 'vibrant'), spotify_client_id=config.get('SPOTIFY_CLIENT_ID', ''), spotify_client_secret=config.get('SPOTIFY_CLIENT_SECRET', ''), + spotify_redirect_uri=config.get('SPOTIFY_REDIRECT_URI', 'http://localhost:5000/callback'), refresh_interval=config.get('REFRESH_INTERVAL', 30), wled_ips=config.get('WLED_IPS', []), spotify_authenticated=status.get('spotify_authenticated', False) @@ -72,6 +73,7 @@ def api_config_update(): try: client_id = request.form.get('client_id', '').strip() client_secret = request.form.get('client_secret', '').strip() + redirect_uri = request.form.get('redirect_uri', '').strip() # Validate and convert refresh interval with proper error handling try: @@ -85,6 +87,7 @@ def api_config_update(): config.set('SPOTIFY_CLIENT_ID', client_id) config.set('SPOTIFY_CLIENT_SECRET', client_secret) + config.set('SPOTIFY_REDIRECT_URI', redirect_uri) config.set('REFRESH_INTERVAL', refresh_interval) config.save() diff --git a/app/templates/index.html b/app/templates/index.html index 8919e69..e356153 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -138,6 +138,15 @@

{{ current_track.name }}

+
+ + + + Must match the redirect URI in your Spotify Dashboard. + Example: http://your-server-ip:5000/callback + +