Hi Netlify Community,
I am working on switching a few applications over to Netlify and switching from the MERN stack to the JAMStack. I am rewriting my old server code to use Netlify functions with Express.
When trying to authenticate someone using both Facebook and Google with Passport.js at my site here: https://mystifying-montalcini-ff4150.netlify.com/ they make it through the whole flow and the user information gets saved in MongoDB like usual.
However, they are redirected back to the index page instead of being taken to my waitlist page meaning they are not logged in. To access the waitlist page you need to be authenticated and I have a simple if statement in my code to check. I have gotten it to work once after clearing all my cookies and then logging in with Google. Unfortunately, it wouldn’t work for any other accounts after this and I kept getting the same behavior.
This is the only thing stopping me from switching all my applications over to Netlify. I would love any help I can get to make this work!
Here is my repository on GitHub: