CorvusModelTokenAuthenticator

public struct CorvusModelTokenAuthenticator<T: CorvusModelTokenAuthenticatable>:
BearerAuthenticator

Provides a BearerAuthenticator struct that defines how tokens are authenticated.

  • The token’s user.

    Declaration

    Swift

    public typealias User = T.User
  • The database the token is saved in.

    Declaration

    Swift

    public let database: DatabaseID?
  • Authenticates a token.

    Declaration

    Swift

    public func authenticate(
        bearer: BearerAuthorization,
        for request: Request
    ) -> EventLoopFuture<Void>

    Parameters

    bearer

    The bearer token passed in the request.

    request

    The Request to be authenticated.

    Return Value

    An empty EventLoopFuture.