test(req, res, next)
Run the middleware's check. If an authenticated session exists, let the request continue. If an authenticated session doesn't exist, write the destination to the session and redirect the user to the login page.
the incoming Express request
the corresponding Express response
Express handler stack callback. This should be called if the middleware check passed to allow the request to continue.