"Set up Passport" -Advanced Node.js Error

Tell us what’s happening:

So I’ve been working on this project through repl but cant get the correct solution. My code on my server.js file is exactly the same as this Advanced Node and Express - Set up Passport · GitHub, I’ve imported and required both passport and express-session, and Ive set the ‘SESSION_SECRET’ in my env file. From what I understand that should be enough to solve the challenge but for some reason I get the following error when I try and run the server. Would anyone have any guidance as to where to go from here?

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36.

Challenge: Set up Passport

Link to the challenge:

Welcome there,

Without seeing your code, it is impossible to tell. Would you mind sharing the link to your code?

Have you debugged whether the value of process.env.SESSION_SECRET is correct (not undefined)?

here is the link to my repl project - I appreciate your help!

There seems to be a misunderstanding about the .env file.

All I did to get past the error is create a .env file, and add SESSION_SECRET=someval to it. If you are unaware of how .env files work, I recommend these resources:

If you have any specific questions, feel free to ask them. (P.S. I have deleted the .env file in your project, so you can go through the steps to create)

Hope this helps

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.