RequireGuest

flitter-auth/deploy/routing/middleware/RequireGuest~ RequireGuest

This middleware is provided by Flitter-auth. It will redirect the user back to their previous location if the session contains the user object.

Constructor

new RequireGuest()

Source:

Methods

test(req, res, next)

Source:

Run the middleware test. If an authenticated session exists, redirect the user to an error page. Otherwise, allow the request to continue.

Parameters:
Name Type Description
req Express/Request

the incoming Express request

res Express/Response

the corresponding Express response

next function

The callback to continue the Express request handling stack. This is called if the middleware check passes.