AlbertaSat / ex2_ground_station_website

Ground station user interface for Ex-Alta 2.
6 stars 3 forks source link

Prevent login-restricted pages from being accessed by non-logged in users #91

Open jmmabanta opened 2 years ago

jmmabanta commented 2 years ago

Bug Description

Pages like flightschedule, automatedcommandsequence, livecommands, and logs are still accessible without login by going directly to their URL. Though this is not really a security issue as their API calls require an authentication token, they become unresponsive when a user accidentally visits these pages without being logged in.

To Reproduce

Steps to reproduce the behaviour:

  1. Logout of any account
  2. Go to http://localhost:8000/flightschedule or http://localhost:8000/livecommands, etc.
  3. Interacting with the page (eg: send a command, submit a flight schedule, etc.)
  4. Website shows no indication of why it isn't working but the Network tab in DevTools indicates that an authentication token is needed

Expected Behaviour

When these pages are visited without a valid login, it should instead redirect back to the homepage and alert the user that they aren't login (the alert can be done with a Snackbar + Alert component from MaterialUI to keep design consistent).