Advanced Node and Express - Set up Passport

Tell us what’s happening:
Describe your issue in detail here.
Cannot seem to pass the SESSION_SECRET test in the .env file; always results in: ‘Error: secret option required for sessions’
Your code so far

'use strict';
const express = require('express');
const myDB = require('./connection');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
const session = require('express-session');
const passport = require('passport');
const app = express();

app.set('view engine', 'pug');
app.set('views', './views/pug');

  secret: process.env.SESSION_SECRET,
  resave: true,
  saveUninitialized: true,
  cookie: { secure: false }


fccTesting(app); // For fCC testing purposes
app.use('/public', express.static(process.cwd() + '/public'));
app.use(express.urlencoded({ extended: true }));

app.route('/').get((req, res) => {
  res.render('index', { title: 'Hello', message: 'Please log in' });

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
  console.log(`Listening on port ${PORT}`);


**Your browser information:**

User Agent is: <code>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36</code>

**Challenge:**  Advanced Node and Express - Set up Passport

**Link to the challenge:**

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