Yooooomi / your_spotify

Self hosted Spotify tracking dashboard
GNU General Public License v3.0
2.64k stars 108 forks source link

Add dedicated frontend error page when API_ENDPOINT points to the frontend #404

Closed RagingCactus closed 1 month ago

RagingCactus commented 1 month ago

Sometimes users set the API_ENDPOINT variable to the frontend instead of the backend by accident. When they do that, they currently see an empty page when they try to log in.

This PR adds a dedicated error page when the path /oauth/spotify is accessed in the frontend. This should never happen, the corresponding request should end up at the backend instead. Displaying a detailed error page in that case should reduce user frustration and error reports resulting from this misconfiguration.

grafik

Feel free to refactor, reformat, change or even rewrite this as needed. I usually don't develop frontends, so doing it this way may be unconventional. However, I do believe that adding something like this will reduce the number of issues that are opened. For example, I believe that at least the initial post in #403 shows exactly this misconfiguration.

Yooooomi commented 1 month ago

Many thanks man