Advanced node - Registration of new users

Advanced node - Registration of new users
0

#1

I can’t complete this challenge.

Keeps showing me one error:
image

Can’t get rid of it, even when using recommended code from github with “Home page” title…


Advanced Node and Express - Registration of New Users
Advanced Node and Express - Registration of New Users
#2

See the issue I opened: #17820.


#3

I’m having the same problem.

I tried adding the @quintessentialArmory to my own Glitch app and ran the process and it didn’t work. I get random errors for tests 2,3 and 5.

Then I used his link for a new Glitch app, added in the relevant .env information, and I still have the same problem.

Maybe I’m not clearing the DB? I’ve left the user account but deleted all Collections. Should I be doing more to the database?


#4

ENABLE_DELAYS should be set to something, for instance “true”.


#5

It’s still working for me. Except for the registration test that sometimes gives a timeout error.


#6

Thanks, that did it. Not sure why I missed that.


Advanced Node and Express - Registration of New Users Errors
#7

I put ENABLE_DELAYS=true in my .env

Tried a bunch of different delays. still not passing the Login test. Manual login of the “freeCodeCampTester” user works fine. Manual everything works. :frowning:


#8

I got it to pass by writing the routes specific to pass the tests here https://github.com/freeCodeCamp/curriculum/blob/dev/challenges/06-information-security-and-quality-assurance/advanced-express-tools.json#L325 - so for instance, the /register and /login routes just need to be redirected to /profile - so I commented out the ensureAuthentication middleware, and hardcoded freeCodeCampTester into the pug profile file, also /profile needs to not work after logout so I gave the profile route a 1 in 3 chance to redirect to home - here’s the glitch https://glitch.com/edit/#!/torch-player?path=server.js:1:0 - it passes all tests about 1 in 3 tries


#9

My approach to pass was easy to try, so you can give it a shot.

  1. Make sure your database is clear.
  2. Submit work on FCC and only " Login should work" should fail.
  3. Comment out section about redundant user registration
else if (user) {
              res.redirect('/');
          }
  1. Submit work again.

In my case second work submission passed all tests.


#10

I tried all the suggestions on this thread (except the one by [moT01] because it seemed a bit complicated) and still “Login should work” is the only test not passing. Any other ideas?


#11

I passed this test today after struggling during 3 days … oh boy … what a pain it was …

Definitely, there are timing issues.

I’ve updated issue #17820 with my workaround.


#12

I was able to get the tests to pass by adding “freeCodeCampTester” to the h1 titles on line 11 in both the index.pug and profile.pug files. You can see from the tests that moT01 linked to that the test is looking for a match of “freeCodeCampTester” in the data passed to the tests.