CarreOriginal post
Rank 1: Thread
Hello, i am trying to make a secure login system to my website. I have completed Login and Signup so the user get saved to Auth page and Database. I am trying to secure some of my pages so you want access it without being logged in. I also want to make it so if the user is loggedin and trying to go to login or signin page he gets dedirectet to home page. I have made 2 maps, one Auth and one Root and wounder if there is any way to secure the folder and all the pages in it? What is the easiest way to make it work?
Thanks for the help, i am new to NextJS
Summary
Developers seeking help with securing pages in a NextJS website. They have implemented login and signup functionalities and want to restrict access to certain pages for logged-in users. They are looking for a way to protect a folder and its content. The easiest solution is to use a middleware function to check the user's authentication status before rendering protected pages.