CorvusToken
public final class CorvusToken : CorvusModel
extension CorvusToken: CorvusModelTokenAuthenticatable
A default implementation of a bearer token.
-
The corresponding database schema.
Declaration
Swift
public static let schema: String
-
The unique identifier of the model in the database.
Declaration
Swift
@CorvusToken .ID public var id: UUID? { get set }
-
The string value of the token.
Declaration
Swift
@CorvusToken .Field public var value: String { get set }
-
The
CorvusUser
that the token belongs to.Declaration
Swift
@CorvusToken .Parent public var user: CorvusUser { get set }
-
Empty initializer to create without args.
Declaration
Swift
public init()
-
Initializes
CorvusToken
with arguments.Declaration
Swift
public init(id: UUID? = nil, value: String, userID: CorvusUser.IDValue)
Parameters
id
The id of the
CorvusToken
.value
The
string
value of theCorvusToken
.userID
The id of the
CorvusUser
theCorvusToken
belongs to. -
Prevents tokens from being deleted after authentication.
Declaration
Swift
public var isValid: Bool { get }