Static Methodvapor 4.106.3Vapor
redirectMiddleware(path:)
Basic middleware to redirect unauthenticated requests to the supplied path
RedirectMiddleware.swift:8static func redirectMiddleware(path: String) -> Middleware
Parameters
- path
The path to redirect to if the request is not authenticated
Other members in extension
Type members
static func guardMiddleware(throwing: Error
) -> Middleware This middleware ensures that an
Authenticatable
typeA
has been authenticated by a previousMiddleware
or throws anError
. 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.static func redirectMiddleware(makePath: @escaping (Request) -> String
) -> Middleware Basic middleware to redirect unauthenticated requests to the supplied path