codefordenver / Comrad

Open-source web application for radio stations to manage show schedules, traffic and compliance
ISC License
25 stars 9 forks source link

Redirect users to login page when they are not authenticated #864

Open seankwilliams opened 11 months ago

seankwilliams commented 11 months ago

If you are logged out and visit pages like https://comrad.kgnu.org/reporting/charting, you see the page but cannot do anything.

Right now, the app only redirects users to the login screen if they are unauthenticated when an API request happens. It should redirect users to the login page when directly visiting pages like https://comrad.kgnu.org/reporting/charting

kmid5280 commented 11 months ago

@seankwilliams Do you supposed this needs to be fixed by adding some sort of "isLoggedIn" conditional on each affected page, or do you have other suggestions?

seankwilliams commented 11 months ago

@kmid5280 I am not sure. I'd look around to see if there are any best practices for other apps like Comrad, that are running with a separate static asset server and API server.

seankwilliams commented 11 months ago

@kmid5280 Or rather, running those on different ports.