bmwoodside / FB-Clone

facebook clone, maybe?
0 stars 0 forks source link

Session/Cookies authorization/authentication #4

Open bmwoodside opened 2 years ago

bmwoodside commented 2 years ago
bmwoodside commented 2 years ago

added "force login cookie to view any page in the application (hold user at login/reg until validated)" item

bmwoodside commented 2 years ago

third task (force login cookie to view any page in the application (hold user at login/reg until validated)) is partially completed. This needs a re-write and a re-think to how we're storing user.

bmwoodside commented 2 years ago

I think a re-write is necessary: call out the useEffect from Main.jsx and handle the "user" state information in App.js. This will then have a requirement to pass user down to all routes as props or ... maybe through useContext (probably better) which will allow us to ensure that only "logged-in" users are able to view information (everyone else will redirect to the login component).