From c9d83d5d13fb3f5bfcd2c5bf3b372422103c472e Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Fri, 6 Mar 2026 10:27:17 -0800 Subject: [PATCH] Fix Tidal OAuth PKCE verification on Flask callback route --- web_server.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web_server.py b/web_server.py index e85af743..e97c3c4d 100644 --- a/web_server.py +++ b/web_server.py @@ -4679,6 +4679,12 @@ def tidal_callback(): try: # Create a temporary client for the token exchange temp_tidal_client = TidalClient() + + # Restore PKCE values from the auth request (matches HTTPServer handler logic) + with tidal_oauth_lock: + temp_tidal_client.code_verifier = tidal_oauth_state["code_verifier"] + temp_tidal_client.code_challenge = tidal_oauth_state["code_challenge"] + success = temp_tidal_client.fetch_token_from_code(auth_code) if success: