spotify / spotify-web-playback-sdk-example

React based example app that creates a new player in Spotify Connect to play music from in the browse using Spotify Web Playback SDK.
Apache License 2.0
141 stars 189 forks source link

Front-End and Back-End Proxying is Insufficient to Remove CORS Errors #10

Open anth-volk opened 1 year ago

anth-volk commented 1 year ago

When attempting to launch this package, each attempt to fetch any existing user tokens and/or login failed with Error 403: Forbidden. I was only able to resolve these issues by installing and using cors middleware, then changing all relevant links to the actual back-end route instead of the port 3000 proxy that this app uses by default. This also required re-configuring the Spotify application dashboard to set the callback URI to the un-proxied address.

ChrissaK commented 3 months ago

I'm having exactly the same issue following this example: requests to http://localhost:3000/auth/* are not forwarded to http://localhost:5000/auth/*. Why is that? Is there a solution to this issue, except for using cors?

anth-volk commented 3 months ago

To be honest, I really don't know. I chocked it up to this package just being mostly unmaintained at this point, so perhaps the issues arose after the feature was introduced? But I haven't dug much deeper than that.