question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Advanced Node and Express - Set up Passport - Missing dotenv install instructions

See original GitHub issue

Describe your problem and how to reproduce it: I am running Node.js on my own server.

Working through the Advanced Node and Express - Set up Passport challenge. The instructions tell you to “Be sure to add ‘SESSION_SECRET’ to your .env file and give it a random value”, which I did.

I was getting an error “express-session deprecated req.secret; provide secret option”, which debugged to the SESSION_SECRET variable being blank or undefined.

Further searches revealed that in order for .env to work, the dotenv library needs to be installed and configured. My understanding is that the old glitch environment would automatically import .env files, possibly Repl.it as well?

I found that in a later challenge there is this verbiage: https://www.freecodecamp.org/learn/quality-assurance/advanced-node-and-express/implementation-of-social-authentication-ii

Do not forget to require and configure dotenv to use your environment variables.

This challenge also needs to be updated to include the same verbiage.

Add a Link to the page with the problem: https://www.freecodecamp.org/learn/quality-assurance/advanced-node-and-express/set-up-passport

Tell us about your browser and operating system:

  • Browser Name: node.js
  • Browser Version: v12.18,3
  • Operating System: Ubuntu 18.04.5 LTS

If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
RandellDawsoncommented, Sep 11, 2020

@SaintPeter The repo has been updated now that the PR referenced by @Sky020 has been merged. It slipped through the cracks when production was deployed earlier today. Sorry for any confusion this may have caused. Let us know if everything seems to be present now, so we can close this issue. We will wait for your feedback.

Thank you.

2reactions
ShaunSHamiltoncommented, Sep 11, 2020

but that the corresponding changes had not yet been made to the boilerplate code?

Yes. Well, the changes are made, but have not been merged. This is done, because once a PR is merged here (on the main repo), it is usually only pushed to production in a few days, but, with the boilerplate repos, a merge targets the branch used by campers. So, it is immidiate.

The means we wait for a main repo change to reach production, before merging the boilerplate, to, ironically, avoid this situation - confusion of mismatched boilerplate/lesson.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Done] Advanced Node and Express - Set up ...
Usually you need to install a package like dotenv and then put something like require('dotenv').config() at the top of your server.
Read more >
Getting Missing required parameter: scope Passport.js ...
I was getting an error when trying to Sign in/up with Google account: Missing required parameter: scope and the following lines of code ......
Read more >
Build and Secure a GraphQL Server with Node.js
With Express, you can easily create a fresh Node.js server with limited code, that is performant enough to serve as a GraphQL server....
Read more >
Bulletproof node.js project architecture 🛡️
A simple yet powerful project architecture for node.js REST APIs.
Read more >
node-express-typeorm-app - NPM Package Overview
For more details, check the features list below. Quick Start. Setup database settings inside ormconfig.json file. To create a project, simply ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found