Harrison

// middlewares/auth.js
exports.isAuthenticated = (req, res, next) => {
  if (req.session.user) return next()
  req.flash('error_msg', 'You must be logged in')
  res.redirect('/auth/gitlab') // if using GitLab only
}
Back to Snippets

Live GitLab Issues