Macro
AuthMiddleware(_:using:)
Injects an authenticated handler parameter using middleware resolved from its controller.
@attached(peer) macro AuthMiddleware<T, Controller>(_ authenticationType: T.Type, using middleware: (Controller) -> any Middleware) where T : Authenticatable
Overview
Pass a key-path literal such as \Self.authentication, or a factory such as { (controller: Self) in UserAuthenticator(databases: controller.databases) }. The generated boot(routes:) evaluates the factory with the controller instance.