Certain pages should only be accessible if the user is logged in. We should use NextJS' middleware feature to prevent and redirect non-authed users from these pages.
Criteria
Create a NextJS middleware file ran for all pages requiring the user to be logged in
Said middleware should validate the user authentication
If user doesn't have valid auth, redirect user to /login
Middleware should only run for currently relevant pages such as /p and /c/create
Document middleware auth validation
Side Quests
These are required to make API requests from the NextJS middleware
Certain pages should only be accessible if the user is logged in. We should use NextJS' middleware feature to prevent and redirect non-authed users from these pages.
Criteria
/p
and/c/create
Side Quests These are required to make API requests from the NextJS middleware