diff --git a/Sources/Authentication/Basic/BasicAuthenticatable.swift b/Sources/Authentication/Basic/BasicAuthenticatable.swift index 060b7eb..432bef0 100644 --- a/Sources/Authentication/Basic/BasicAuthenticatable.swift +++ b/Sources/Authentication/Basic/BasicAuthenticatable.swift @@ -5,14 +5,14 @@ import Fluent /// Authenticatable by `Basic username:password` auth. public protocol BasicAuthenticatable: Authenticatable { /// Key path to the username - typealias UsernameKey = ReferenceWritableKeyPath + typealias UsernameKey = WritableKeyPath /// The key under which the user's username, /// email, or other identifing value is stored. static var usernameKey: UsernameKey { get } /// Key path to the password - typealias PasswordKey = ReferenceWritableKeyPath + typealias PasswordKey = WritableKeyPath /// The key under which the user's password /// is stored. diff --git a/Sources/Authentication/Bearer/BearerAuthenticatable.swift b/Sources/Authentication/Bearer/BearerAuthenticatable.swift index 9d2bedc..e6db1ac 100644 --- a/Sources/Authentication/Bearer/BearerAuthenticatable.swift +++ b/Sources/Authentication/Bearer/BearerAuthenticatable.swift @@ -5,7 +5,7 @@ import Fluent /// Authenticatable by `Bearer token` auth. public protocol BearerAuthenticatable: Authenticatable { /// Key path to the token - typealias TokenKey = ReferenceWritableKeyPath + typealias TokenKey = WritableKeyPath /// The key under which the model's unique token is stored. static var tokenKey: TokenKey { get } diff --git a/Sources/Authentication/TokenAuthenticatable.swift b/Sources/Authentication/TokenAuthenticatable.swift index 987268c..ea7df31 100644 --- a/Sources/Authentication/TokenAuthenticatable.swift +++ b/Sources/Authentication/TokenAuthenticatable.swift @@ -17,7 +17,7 @@ public protocol Token: BearerAuthenticatable { where UserType.Database == Database /// A relation to the user that owns this token. - static var userIDKey: ReferenceWritableKeyPath { get } + static var userIDKey: WritableKeyPath { get } } extension TokenAuthenticatable { diff --git a/Tests/AuthenticationTests/User.swift b/Tests/AuthenticationTests/User.swift index 6005440..299be41 100644 --- a/Tests/AuthenticationTests/User.swift +++ b/Tests/AuthenticationTests/User.swift @@ -14,8 +14,8 @@ final class User: Model, Migration, BasicAuthenticatable { typealias ID = UUID static let idKey: IDKey = \User.id - static let usernameKey = \User.email - static let passwordKey = \User.password + static let usernameKey: UsernameKey = \User.email + static let passwordKey: PasswordKey = \User.password var id: UUID? var name: String