mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #317] [Feature]: Spotify DJ login when Marinara is accessed from another device #133
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#133
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @LightD31 on GitHub (Apr 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/317
What problem does this solve?
The Spotify DJ agent's OAuth callback is hardcoded to
http://127.0.0.1:<PORT>/api/spotify/callback. When Marinara runs on a different machine than the browser (LAN install, remote server, Tailscale, phone-on-Wi-Fi, etc.), Spotify redirects the popup to127.0.0.1on the browser's machine — where nothing is listening — so the connect flow silently times out after 5 minutes.Naively swapping in the LAN IP doesn't fix it: Spotify tightened redirect-URI rules in Feb 2025 so registered URIs must be
https://<any-host>or the loopback literalshttp://127.0.0.1/http://[::1].localhostand LAN IPs (e.g.http://192.168.1.42:7860) are rejected at registration time.Proposed solution
Three-pronged so every reasonable deployment shape works:
https://<host>/api/spotify/callbackwhen the request is HTTPS (own TLS orX-Forwarded-Proto: https); keephttp://127.0.0.1:<PORT>/...for localhost; fall back to the same loopback URI for plain-HTTP non-loopback (since Spotify rejects everything else).SPOTIFY_REDIRECT_URIenv override for HTTPS-terminated-upstream setups where the request host doesn't match the public URL.code+statefrom the URL and completes the token exchange against the existing PKCE pending-auth entry.Alternatives considered
Additional context
HOST=0.0.0.0on machine A, openhttp://<machine-A-IP>:7860from machine B, try to connect Spotify → popup loadshttp://127.0.0.1:7860/api/spotify/callbackon machine B and fails.packages/server/src/config/runtime-config.ts—getSpotifyRedirectUri().Template check