The RequireAuth Middleware
Middleware that, when applied, redirects the user to the login page if they are not authenticated.
test(express.request req, express.response res, function next)
req.session.auth.user exists, or
true. If these are, that means that a user is logged in. If this check passes, then call the
next function in the stack, allowing the request to continue. Otherwise, write
req.session.destination and redirect to the