public final class GuardAuthenticationMiddleware<A> : Middleware where A : Authenticatable
This middleware ensures that an
A has been authenticated
by a previous
Middleware or throws an
Error. The middlewares that actually perform
authentication will not throw errors if they fail to authenticate the user (except in
some exceptional cases like malformed data). This allows the middlewares to be composed
together to create chains of authentication for multiple user types.
Use this middleware to protect routes that might not otherwise attempt to access the authenticated user (which always requires prior authentication).
Authenticatable.guardAuthMiddleware(...) to create an instance.