JWT
extension JWT: TypeSafeCredentials
-
Note: This field does not apply to Type-safe JWT credentials. Use the JWT claims instead.
Declaration
Swift
public var id: String { get } -
Answers
JWT.Declaration
Swift
public var provider: String { get } -
Attempts to authenticate a request with an Authorization header containing a JWT. The possible outcomes depend on the
X-token-typeheader:- If
X-token-typeis set toJWT, then this will either succeed or fail. - If
X-token-typeis set to another value, this will pass (defer to other type-safe middlewares in the case of multi-auth). - If
X-token-typeis not set, then this and will either succeed or pass.
Declaration
Swift
public static func authenticate(request: RouterRequest, response: RouterResponse, onSuccess: @escaping (JWT<T>) -> Void, onFailure: @escaping (HTTPStatusCode?, [String : String]?) -> Void, onSkip: @escaping (HTTPStatusCode?, [String : String]?) -> Void) - If
View on GitHub
JWT Extension Reference