Token
final class Token : Modelextension Token: ModelTokenAuthenticatableA Token model associates a randomly generated string with a User.
A Token is generated upon each login, and revoked by deletion upon each logout.
The .token value is used in between those events in an HTTP Bearer Authorization
header field to authenticate the user sending API requests. There is no
identifying user info in a .token; the association to a specific User is
done internally on the API server through this model.
- 
                  
                  DeclarationSwift static let schema: String
- 
                  
                  The Token’s ID, provisioned automatically. DeclarationSwift @ID var id: UUID?
- 
                  
                  The generated token value. DeclarationSwift @Field var token: String
- 
                  
                  Timestamp of the model’s creation, set automatically. DeclarationSwift @Timestamp var createdAt: Date?
- 
                  
                  DeclarationSwift init()
- 
                  
                  Initializes a new Token. DeclarationSwift init(token: String, userID: UUID)ParameterstokenThe generated token string. userIDThe Userassociated to the token.
- 
                  
                  Required key for HTTP Bearer Authorization token. DeclarationSwift static let valueKey: <<error type>>
- 
                  
                  DeclarationSwift static let userKey: <<error type>>
- 
                  
                  DeclarationSwift var isValid: Bool { get }
 View on GitHub
            View on GitHub
           Token Class Reference
      Token Class Reference