Hello everyone. I cannot pass the following test:
You should be passing the variable username with req.user.username into the render function of the profile page
.
And here is my code:
app.post('/login', passport.authenticate('local', {failureRedirect:"/"}), (req,res)=>{
res.redirect("/profile");
});
app.get('/profile', ensureAuthenticated, (req,res)=>{
res.render(process.cwd()+ "views/pug/profile", {username: req.user.username});
});
Any help will be much appreciated. Thank you in advance.