How to redirect users to my application after Spotify logout

I’m working on a Node.js application that uses the Spotify Web API. I’ve added a logout feature where users can sign out of their Spotify account.

Right now when users click logout, I send them to:

https://accounts.spotify.com/en/logout

This works fine and logs them out, but they end up staying on Spotify’s logout page. I want to automatically bring them back to my app’s main page once the logout process is complete.

Is there a way to add a return URL parameter or use some other method to redirect users back to my application after they finish logging out from Spotify?

I’ve built several Spotify integrations and found the best way is handling logout on your backend, not client-side. Here’s what works: create a logout endpoint in your Node.js app that revokes the access token through Spotify’s API, clears session data from your database, then redirects to your landing page. You’ll skip Spotify’s logout page completely while still cleaning everything up properly. The token revocation API handles the Spotify logout without any browser redirects or popups - way cleaner than those timeout hacks people suggest.

yeah, i get how frustrating it is with spotify! what i do is open the logout in a new tab and then set a timeout to refresh my app after a bit. not the best solution, but it does the trick!

Spotify doesn’t provide a redirect parameter for logout, which can be frustrating. I’ve encountered this same issue in production. In my experience, implementing a client-side logout is more effective than relying on popups. I typically clear all stored tokens first and then redirect to Spotify’s logout URL. Following that, I use a meta refresh or a JavaScript redirect back to my application within 2-3 seconds. Users will see a temporary “logging out…” message before being redirected. The key insight is that once tokens are cleared, the user is effectively logged out from your application’s standpoint, making the Spotify logout process simply a cleanup step.

Had this same problem a few months ago. Spotify doesn’t support redirect parameters for logout - super annoying.

Popup solutions work but they’re clunky. I built a proper flow with automation instead.

Created a webhook that handles the whole logout sequence. User clicks logout → triggers workflow that clears tokens from my database, calls Spotify’s logout in the background, then redirects smoothly to my main page.

Key is using an automation platform that handles HTTP requests, database ops, and conditional logic in one flow. Users get a seamless experience without weird popup delays.

Built the whole thing in 10 minutes with drag and drop. No more users stuck on Spotify’s logout page.

Indeed, Spotify’s logout process seems a bit cumbersome. What I found useful is to clear the access tokens from your server before calling the logout. Then, use window.open() to initiate the logout in a new tab. After a brief timeout, you can close that popup and redirect the main window back to your application’s homepage. It’s not a flawless solution, since it doesn’t confirm that the logout has completed, but it does provide a better experience than leaving users on Spotify’s page.

just handle logout locally instead of using spotify’s page. clear your tokens and redirect back to your app quickly - users won’t even see the spotify page.