Second Challenge Fail

Tell us what’s happening:
I already put this code.

app.route(‘/logout’)
.get((req, res) => {
req.logout();
res.redirect(‘/’);
});

app.use((req, res, next) => {
res.status(404)
.type(‘text’)
.send(‘Not Found’);
});

Failed: Logout should redirect to the home page.
It’s not working on the homepage.

Your project link(s)

solution:

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.53 Safari/537.36 Edg/103.0.1264.37

Challenge: Logging a User Out

Link to the challenge:

The link to your project is not valid. I get a 404 error when I clicked on it above.

I made it public on my account.

[Advanced Node and Express - Replit]
(Advanced Node and Express - Replit)

I notice in your package.json file that your version of passport is not what was specified in this challenge of the Advanced Node and Express section. Try changing to the specified version and see if that fixes your issue.

Thank you. I pass the test.

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