Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case let apiKey as APIKey:
- guard let user = try User.query().filter(“username”, apiKey.id).first(),
- try BCrypt.verify(password: apiKey.secret, matchesHash: user.password) else {
- throw Abort.custom(status: .networkAuthenticationRequired, message: “Invalid user name or password.”)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement