summaryrefslogtreecommitdiff
path: root/middlewares/requireAuth.js
blob: 4d85e4393752ddd22cc6e2148307ab76b6c49467 (plain)
1
2
3
4
5
6
7
8
function requireAuth(req, res, next) {
	if (req.session.user !== undefined) {
		return next();
	}
	return res.redirect(302, '/login');
}

export default requireAuth;