8 lines
177 B
TypeScript
8 lines
177 B
TypeScript
function ensureAuthenticated(req, res, next) {
|
|
if (req.isAuthenticated()) {
|
|
return next();
|
|
}
|
|
res.redirect('/login');
|
|
}
|
|
|
|
module.exports = ensureAuthenticated; |