Last active
December 20, 2016 17:59
-
-
Save calebkleveter/8f070240c58d570a688bfb17554ae2e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment