I have recently posted on step 7 of the Section " Advanced Node and Express": How to Use Passport Strategies - and I was stuck due to some DB connection errors / wrong URI…
I have restarted the challenges on a new glitch project and have reached the " Implement the Serialization of a Passport User" step.
I m pretty solid on the code as I used my previous one (which reaches two steps further) but I am still a big newbie and can’t understand my database mistakes.
Here is the error as in the log:
.env: line 1: 7: command not found
12:48 PM
.env: line 2: XXX: No such file or directory
12:48 PM
Thu, 06 Feb 2020 11:48:15 GMT express-session deprecated req.secret; provide secret option at server.js:32:3
12:48 PM
Database error: MongoParseError: URI malformed, cannot be parsed
Here is my .env file (I adapted the password in the real code) :
This is just an example; the ‘imaword’ is the same though and I replaced password. You’ll have to check your DATABASE URI again maybe? What I show is just an example, we would be on different clusters/shards.
… i still can’t load your Glitch, after about 10 minutes waiting. So maybe try to start a new boilerplate and copy/paste into it?
Sorry for the late answer - just got back at this project from scratch and eventhough I succesfully pass the test at the Implement the Serialization of a Passport User section , I am, still no able to get connected to my MongoDB Atlas.
I tried different things and managed to get my URI right by adding quotes and this to my mongo connector : {useUnifiedTopology: true}, {useNewUrlParser: true},
YET, it is not working still… So, here is the link to my glitch.