The RequireGuest 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 the
errors/requires_guest view is rendered. Otherwise, the user is a guest (non-authenticated session), and the
next function in the stack is called, allowing the request to continue.