CorvusModelTokenAuthenticatable
public protocol CorvusModelTokenAuthenticatable : CorvusModel, Authenticatable
A protocol that defines bearer authentication tokens, similar to
ModelTokenAuthenticatable
.
-
The
User
type the token belongs to.Declaration
Swift
associatedtype User : CorvusModel, Authenticatable
-
The
String
value of the token.Declaration
Swift
var value: String { get set }
-
A boolean that deletes tokens if they’re not in use.
Declaration
Swift
var isValid: Bool { get }
-
authenticator(database:
Extension method) Provides a
Vapor
authenticator defined below.Declaration
Swift
public static func authenticator( database: DatabaseID? = nil ) -> CorvusModelTokenAuthenticator<Self>
Parameters
database
The database to authenticate.
Return Value