Skip to content

Commit 3f9493e

Browse files
committed
Fluent 3 RC-4
1 parent 807d89d commit 3f9493e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/JWTAuthenticatable/BasicJWTAuthenticatable.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct UsernamePassword<Model: BasicJWTAuthenticatable>: Codable {
4646
///
4747
/// The `AuthBody` type is constrained to `BasicAuthorization` and the `Database` type
4848
/// must conform to the `QuerySupporting` protocol.
49-
public protocol BasicJWTAuthenticatable: JWTAuthenticatable where AuthBody == BasicAuthorization, Database: QuerySupporting {
49+
public protocol BasicJWTAuthenticatable: JWTAuthenticatable where AuthBody == BasicAuthorization {
5050

5151
/// The keypath for the property
5252
/// that is used to authenticate the
@@ -86,7 +86,7 @@ extension BasicJWTAuthenticatable {
8686

8787
// Fetch the model from the database that has an ID
8888
// matching the one in the JWT payload.
89-
return try Self.find(payload.id, on: request)
89+
return Self.find(payload.id, on: request)
9090

9191
// No user was found. Throw a 404 (Not Found) error
9292
.unwrap(or: Abort(.notFound, reason: "No user found with the ID from the access token"))
@@ -108,7 +108,7 @@ extension BasicJWTAuthenticatable {
108108

109109
// Get the user where the property referanced by `usernameKey` matches the `body.username` value.
110110
// If no model is found, throw a 401 (Unauothorized) error.
111-
let futureUser = try Self.query(on: request).filter(Self.usernameKey == body.username).first().unwrap(or: Abort(.unauthorized, reason: "Username or password is incorrect"))
111+
let futureUser = Self.query(on: request).filter(Self.usernameKey == body.username).first().unwrap(or: Abort(.unauthorized, reason: "Username or password is incorrect"))
112112

113113
return futureUser.flatMap(to: (Payload, Self).self) { (found) in
114114

0 commit comments

Comments
 (0)