Class
Request.Authentication
Stores and fetches the instances authenticated for a request.
final class Authentication
Overview
Owned by the Request and shared for its whole lifetime, so an instance logged in by an inner middleware stays visible to an outer middleware as the response unwinds — that is how SessionAuthenticator persists a user authenticated further down the chain. Reading has no side effects.
See RequestAuthenticator for more information.
Topics
Instance Methods
func get<A>(A.Type) -> A?Look up an instance of the supplied type, if one has been authenticated.func has<A>(A.Type) -> BoolLook up whether or not an instance of the supplied type has been authenticated.func login<A>(A)Authenticates the supplied instance for this request.func logout<A>(A.Type)Unauthenticates an authenticatable type.func require<A>(A.Type) throws(Abort) -> ALook up an instance of the supplied type, treating it as an error if there is no such instance.
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype