Getting “401 Unauthorized” when accessing protected route in Express.js with express-session and passport
I’m building a blob web application using Express.js where users can log in and access protected routes. I’ve set up session management using express-session and authentication with passport-local. However, when I try to access the /home route after logging in, I’m consistently getting a “401 Unauthorized” error. It might briefly open for like 1-2 sec and then direct me to /login.