Solved with changing the code to: app.delete('/logout', function(req, res, next){ req.logout(function(err) { if (err) { return next(err); } res.redirect('/login'); }); });
Solved with changing the code to:
app.delete('/logout', function(req, res, next){
req.logout(function(err) {
if (err) { return next(err); }
res.redirect('/login');
});
});