Skip to content

Commit 73b0f84

Browse files
authored
Merge pull request #10 from vapor/bcrypt-passwordverifier
Make BCryptHasher conform to PasswordVerifier
2 parents 12cfcb3 + b49f2a8 commit 73b0f84

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
/Packages
44
/*.xcodeproj
55
Package.pins
6+
DerivedData
67

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Vapor
2+
3+
extension BCryptHasher: PasswordVerifier {
4+
public func verify(password: Bytes, matches hash: Bytes) throws -> Bool {
5+
return try check(password, matchesHash: hash)
6+
}
7+
}

0 commit comments

Comments
 (0)