Advanced Node and Express - ensureAuthenticated always failing

Tell us what’s happening:
Hello, I’ve been tried to do the Advanced Node and Express course here on FCC.
I’ve been passing all the tests, but the app is clearly not working.

Specifically, I am having problems with login, where authentication always fails, and I don’t understand why.
The database creates and finds the users (on register and login routes), as I can log them on the console. Serialize also works.

However, somewhere between /login and /profile, the user information seems to be lost and the authentication fails.

There are also some other issues (for example, I always get a “Cannot GET” when I first initialize the app, but refreshing the page solves the problem; Github authentication isn’t working either, as github doesn’t response, even though the tests pass).

Any help would be appreciated, thanks!

Your code so far
This is my repl link: https://replit.com/@DiogoCosta738/boilerplate-advancednode#routes.js

Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36

Challenge: Clean Up Your Project with Modules

Link to the challenge:

Update
Turns out that the authentication succeds when I use the “fullpage view”.

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