From b3afed1599790fce040ca0be9df62146876e9956 Mon Sep 17 00:00:00 2001
From: Broque Thomas <26755000+Nezreka@users.noreply.github.com>
Date: Fri, 24 Apr 2026 14:27:17 -0700
Subject: [PATCH] Fix Tidal device-auth link opening SoulSync instead of
link.tidal.com
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The "Link Tidal Account" device-flow UI displayed a verification URL
like `link.tidal.com/XBXYT` that, when clicked, navigated back to the
SoulSync origin (e.g. `http://localhost:8889/link.tidal.com/XBXYT`)
instead of to Tidal's activation page.
Root cause: tidalapi returns `login.verification_uri_complete` as a
schemeless string. settings.js drops it straight into ``, and
browsers treat schemeless hrefs as same-origin relative URLs.
Normalize the URI in `start_device_auth` — if it doesn't already
start with `http://` or `https://`, prepend `https://`. Same
treatment for the `link.tidal.com/{user_code}` fallback so the
defensive path stays well-formed too.
---
core/tidal_download_client.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/core/tidal_download_client.py b/core/tidal_download_client.py
index 8e7e718d..0823e56d 100644
--- a/core/tidal_download_client.py
+++ b/core/tidal_download_client.py
@@ -265,8 +265,16 @@ class TidalDownloadClient:
login, future = self.session.login_oauth()
self._device_auth_future = future
+ # tidalapi returns `verification_uri_complete` as a schemeless
+ # string like `link.tidal.com/ABCDE`. Passing that straight to
+ # an makes the browser treat it as a relative URL and
+ # route it back to the SoulSync origin, so normalize to a
+ # full https:// URL here.
+ raw_uri = login.verification_uri_complete or f"link.tidal.com/{login.user_code}"
+ if not raw_uri.startswith(('http://', 'https://')):
+ raw_uri = f"https://{raw_uri}"
self._device_auth_link = {
- 'verification_uri': login.verification_uri_complete or f"https://link.tidal.com/{login.user_code}",
+ 'verification_uri': raw_uri,
'user_code': login.user_code,
}
logger.info(f"Tidal device auth started — code: {login.user_code}")