Implement Serialization Error (Advanced Node)

Tell us what’s happening:
The test “Database connection should be present.” keeps failing. The console shows nothing. The preview shows a “Cannot /get” message. All IPs have been whitelisted on the Atlas website (0.0.0.0/0).

The MONGO_URI is included in the .env variables.

Any help would be immensely appreciated.

Your project link(s)

solution: https://replit.com/@ikersuarez/boilerplate-advancednode

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15

Challenge: Implement the Serialization of a Passport User

Link to the challenge:

Hello there,

You appear to have forgotten to follow this instruction:

Be sure to uncomment the myDataBase code in deserializeUser , and edit your done(null, null) to include the doc .

Hope this helps

Hi, thanks for your help! I don’t see the deserializer commented, though (unless I’m mistaken and it’s a different part of the code).

Apologies, I was mistaken. That code is as expected - I misread the instruction :sweat_smile:

When I fork you project, and input my URI, I see this error in the console:

Error: secret option required for sessions
    at session (/home/runner/boilerplate-advancednode-2/node_modules/express-session/index.js:200:12)

Have you set the SESSION_SECRET?

Otherwise, this is the main issue:

res.render('pug', {
      title: 'Connected to Database',
      message: 'Please login'
    });

Your code:

    res.render('pug', {
      title: 'Connected',
      message: 'Please login'
    });

Hope this helps

1 Like

It was the title. Thanks!

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