Wednesday, 9 September 2020

Help with Express + Mongoose + Passport

Hello All,I'm pretty new to programming and Node in particular so please bear with me. I'm working on creating a to do list type website and am running into issues with user authentication using passport. Basically it seems like the deserializeUser function is not being called when Passport authenticates the user on the login post route, and therefore req.user is not being saved in the session.Here's what the console logs when I log-in currently: https://imgur.com/a/rfa2ptmHere is the github repo: https://github.com/rosswillyoung/hadobit-expressThe relevant pieces of code are in the index.js file, the config/passport.js file, and the routes/users file.It's worth noting that I'm calling the post method from a different React project on a different machine, here's the code in the fetch request: https://imgur.com/a/bdQoLxxI'm thinking it has something to do with the way the session is set up but after trying for 2 days now and googling extensively, I'm really at the end of my rope.Thank you for any help you can provide.

Submitted September 09, 2020 at 07:20PM by jahumaca

No comments:

Post a Comment