Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
router.get('/logout', (req, res) => {
req.logOut();
res.redirect(status.SEE_OTHER, '/');
});
export function isAuthenticated(req, res, next) {
if (req.isAuthenticated()) {
return next();
}
req.session.redirectTo = req.originalUrl;
return res.redirect(status.SEE_OTHER, '/auth');
}
.then(() => {
res.redirect(status.SEE_OTHER, `/publisher/${publisher.bbid}`);
});
});
.then(() => {
res.redirect(status.SEE_OTHER, '/message/sent');
});
});
router.get('/logout', (req, res) => {
req.logOut();
res.redirect(status.SEE_OTHER, '/');
});