Closed pedorich-n closed 2 months ago
Thanks for catching this and the detailed write up!
@pedorich-n please try foxxmd/multi-scrobbler:develop
docker image and let me know if that fixes URL issues for you
Thanks for such a quick fix!
The URL does appear to be correct now, with the BASE_URL=http://multi-scrobbler.server.lan:80
:
[App] [API] User-defined base URL for UI and redirect URLs (spotify, deezer, lastfm): http://multi-scrobbler.server.lan/
...
[App] [Sources] [Spotify - spotify] Redirect URL that will be used on auth callback: 'http://multi-scrobbler.server.lan/callback'
But I am getting a 400 HTTP code from MS when trying to authorize Spotify now. I don't know if that's something on MS's side or my reverse proxy or what... The URL I see is http://multi-scrobbler.server.lan/api/callback?code=<code>&state=spotify
. Where did the /api/
come from? 🤔
In the logs, I can see
[2024-06-05 20:07:04.265 +0900] INFO : [App] [API] Received auth code callback from Spotify
[2024-06-05 20:07:02.364 +0900] INFO : [App] [API] Redirecting to spotify authorization URL
But the page still shows "Auth Interaction Required" and no currentCreds-spotify.json
file is created.
Edit:
Upon rolling back to 0.7.1 and using the explicit redirectUri
everything works again. So I assume something changed in the dev branch. 🤔 Also I can see /api/
in URL too, so I guess that's not the problem.
Oops! Missed a string conversion of the base url when passing to the spotify api. Try the newest develop
tag, it should be fixed now.
Yes, it works now! Thank you for the fix!
Describe the bug I am running the
multi-scrobbler
behind the reverse proxy on the addresshttp://multi-scrobbler.server.lan
and specify the same address inBASE_URL
(also triedhttp://multi-scrobbler.server.lan:80
).Two issues arise:
items.mainPort
in the code mentioned above doesn't exist, so I ended up withhttp://multi-scrobbler.server.lan:undefined
as a base url for redirects. Looks like this commit caused this issue.Expected behavior Use the default port when specified.
Logs
Versions (please complete the following information):
Additional context The port gets lost after normalization because the
normalize-url
also usesURL
.I think the code should either assume the port is 80 when not specified, as it seems to be the behavior of
URL
, or at least respect the explicitly specified port even when it's the default.The current workaround for me is to explicitly specify the redirect URLs for sources.