summaryrefslogtreecommitdiff
path: root/middlewares/requireAuth.js
blob: 3cf10ec5e9b934613aaa63e1694ffce97076bd21 (plain)
1
2
3
4
5
6
7
8
function requireAuth(req, res, next) {
	if (req.session.userId) {
		next();
	}
	res.redirect(302, "/login");
}

export default requireAuth;