Protocol
Authenticatable
A protocol to which a type may conform to enable use of that type for authentication.
protocol Authenticatable : Sendable
Topics
Type Methods
static func guardMiddleware(throwing: any Error) -> any MiddlewareThis middleware ensures that anAuthenticatabletypeAhas been authenticated by a previousMiddlewareor 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: @Sendable (Request) -> String) -> any MiddlewareBasic middleware to redirect unauthenticated requests to the supplied pathstatic func redirectMiddleware(path: String) -> any MiddlewareBasic middleware to redirect unauthenticated requests to the supplied path
Relationships
Inherits From
Swift.SendableSwift.SendableMetatype