Currently, an authenticated user can access the /login page and some other pages like /register which they should not have any access to, after being authenticated.
An authenticated user can therefore re-log in, and this alters their lastLoggedIn... column in the database. This should be prevented. This issue aim at writing a middleware that redirect an authenticated users from accessing a certain page.
[ ] Write a middleware for an authenticated user
[ ] Redirect an authenticated user from revisiting the /login and /register
[ ] Make your function generic, so it can be used for other endpoints in the future
Currently, an authenticated user can access the /login page and some other pages like /register which they should not have any access to, after being authenticated.
An authenticated user can therefore re-log in, and this alters their
lastLoggedIn...
column in the database. This should be prevented. This issue aim at writing a middleware that redirect an authenticated users from accessing a certain page.