Good I have an error in Node that I do not understand because it happens:
class HomeController {
getViewLogin(req, res, next) {
if(req.isAuthenticated())
res.redirect('/index');
res.render('singIn', {
title: 'Login'
});
}
getViewIndex(req, res, next){
//console.log(req.user.nombres);
//console.log(req.isAuthenticated());
if(!req.isAuthenticated())
res.redirect('/');
res.render('index', {
title: 'Bienvenido',
user: req.user
});
}
}module.exports = HomeController;
I am simply redirecting when the user is logged in, this code works but returns that error to me. Thanks.