Skip to content

TokenAuthMiddleware

Josh Wright edited this page Jan 14, 2021 · 3 revisions

TokenAuthMiddleware

A Middleware type configured to work with TokenAuthable. This middleware will intercept requests and queries the table backing T for a row matching the token auth headers of the request. If a matching row is found, that value will be associated with the request. If there is no Authentication:​ Token ... header, or the token value isn't valid, an HTTPError(.unauthorized) will be thrown.

public struct TokenAuthMiddleware<T: TokenAuthable>: Middleware

Inheritance

Middleware

Methods

intercept(_:next:)

public func intercept(_ request: Request, next: @escaping Next) -> EventLoopFuture<Response>
Alchemy
Types
Protocols
Global Typealiases
Global Variables
Global Functions
Fusion
Types
Protocols
Papyrus
Types
Protocols
Clone this wiki locally