Closed Googool closed 2 years ago
This will fix the following error - Error: req#logout requires a callback function, which occurs when trying to log out of the dashboard.
Error: req#logout requires a callback function
Replace the code below
router.get('/logout', (req, res) => { if(req.user) { req.logout(); res.redirect('/'); } else { res.redirect('/'); } });
With this
router.get('/logout', (req, res) => { if(req.user) { req.session.destroy(); res.redirect('/'); } else { res.redirect('/'); } });
Hope this will help someone :-)
This will fix the following error -
Error: req#logout requires a callback function
, which occurs when trying to log out of the dashboard.Replace the code below
With this
Hope this will help someone :-)