Dear kind ladies and gentlemen of the freeCodeCamp community,
I implore you: please, lend me your aid!
I’ve been trying to do this exercise for around a week. The aim is to register a new profile using Node, Passport etc.
Here’s the problem: I keep getting the same error, that “login should work”.
Logging in manually seems to work just fine! If I type “freeCodeCampTester” as the login and password (which is what the tester code uses to attempt to login), then it works — the app correctly renders the profile page with a big “Welcome freeCodeCampTester!”. But the test seems to fail every time.
Here’s what I’ve tried so far. As far as I know, I tried every suggestion that I could find by searching this issue on this forum, including:
- adding delays to the “login”, “logout”, “register” functions
- changing the mongoDB Cloud Atlas connection link to use an older version of Node.js (2.2+ instead of 3.0+),
- copy-pasting the code from the provided solution (here — it gives me the same error: login doesn’t work!)
- moving around the various “app.route” lines to come earlier or later than each other
- changing the links by removing “.pug” from “/views/pug/route.pug” & “/views/pug//index.pug” to simply “/views/pug/route” & “/views/pug//index”
- changing the “title” line in “index.pug” to “Home Profile” and in “profile.pug” to “Profile Page”
Here is the error message that I am getting on the freeCodeCamp website: “The profile should properly display the welcome to the user logged in”. Previously, I had gotten a few other errors, like “Login should work if previous test was done successfully and redirect successfully to the profile. Check your work and clear your DB”, but it seems that I’ve managed to finally fix those.
Here is my Glitch page: [edit: removed now for privacy because future exercises needed me to add some GitHub data]
Please help? Thank you very much!!