Implement the Serialization of a Passport User - Not Passing

Implement the Serialization of a Passport User - Test Not Passing

For some reason, I can’t pass this lesson. I have no idea what I’m doing wrong.

Here is a link to my solution: lesson solution

Error: secret option required for sessions

Do you have SESSION_SECRET in your secrets?


Please link to the editor when asking for help.

https://replit.com/@ibekingsley/boilerplate-advancednode

Not sure how to replace the SESSION_SECRETS with the default value in the .env file.

You do not use the .env file on Replit you use the Secrets as shown in the docs I linked to.

SESSION_SECRET is the key and the value can be any random value.

Alright, trying it now…

I followed the instruction in the docs you sent earlier, now the second test passed but the first one failed, It seems that I am not properly connecting the database. @lasjorg

The code is passing for me with my own DB.

I can only assume you also didn’t add the connection string correctly to the secrets. This has all been taught and used before so you should know how to do it.

@lasjorg thank you for your constant help. I have cross-checked my code. I don’t think I understand where the bug is. This is how I added the connect string to the secrets:
image

console.log(process.env.SESSION_SECRET); returns the right SESSION_SECRET value.

Oh success. I added the MONGO_URI to secrets, somehow it worked.

Thank you

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