diff --git a/web_server.py b/web_server.py index d5dd98f6..59b59c7b 100644 --- a/web_server.py +++ b/web_server.py @@ -2738,7 +2738,73 @@ def auth_tidal(): print(f"🔗 Redirect URI in URL: {params['redirect_uri']}") add_activity_item("🔐", "Tidal Auth Started", "Please complete OAuth in browser", "Now") - return f'

🔐 Tidal Authentication

Please visit this URL to authenticate:

{auth_url}

After authentication, return to the app.

' + + # Detect if accessing remotely (copied from Spotify auth logic) + host = request.host.split(':')[0] + is_remote = host not in ['127.0.0.1', 'localhost'] + is_docker = os.path.exists('/.dockerenv') + + # If in Docker and accessing via 127.0.0.1, recommend localhost + if is_docker and host == '127.0.0.1': + host = 'localhost' + + if is_remote or is_docker: + # Show instructions for remote/docker access + page_title = "🔐 Tidal Authentication (Remote/Docker)" + step_1_text = "Click the link below to authenticate with Tidal" + + return f''' + + + + + +

{page_title}

+

Step 1: {step_1_text}

+

{auth_url}

+
+

Step 2: After authorizing, you'll see a blank page or an error. The URL will look like:

+ http://127.0.0.1:8888/tidal/callback?code=... +

Step 3: Change 127.0.0.1 to {host} and press Enter: + +

+ http://{host}:8888/tidal/callback?code=... +

Authentication will then complete!

+ + + + + ''' + else: + return f'

🔐 Tidal Authentication

Please visit this URL to authenticate:

{auth_url}

After authentication, return to the app.

' except Exception as e: print(f"🔴 Error starting Tidal auth: {e}")