maofalt / Transcendence

4 stars 0 forks source link

179 get login status in homepage #192

Closed YoelRidgway closed 6 months ago

YoelRidgway commented 6 months ago
  1. The main purpose was to setup the user info functionality in the frontend and have done exactly that:

    • Made sure the current username is displayed and that the profile picture is retrieved when logged
    • Added functionality to Log out and made it display as "Logged out" in the frontend
    • Protected routes that shouldn't be accessed when not logged in and added helpful info popup in case of attempt to access
    1. While I was there I cleaned up Router a little bit by removing unused routes/views and added a variable in each route that protects it from unauthorized access

    2. I also fixed the pollingFunctions for refresh and for the user details so now it should work smoothly

  2. Lastly I added another router function called redirectTo() that replaces the current state rather than add to it (used for redirecting unauthorized access to login page)