Note that its not a full stack Nextjs project as backend is built in Nodejs. I was wondering what can be best and optimal way in which i can protect my routes from unauthorized access. I saw the Nextjs docs and read about the middleware file I can use but it seems a bit confusing for me . I have auth pages (‘/Login’ , ‘/Signup’) , and dashboard (‘/’) and single post (‘/post/:id’) . I want to protect the dashboard and single post route if user is not logged in , i.e, he should be redirected to login.