aboutsummaryrefslogtreecommitdiff
path: root/pkg/database/password.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/database/password.go')
-rw-r--r--pkg/database/password.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/database/password.go b/pkg/database/password.go
index d24183d..10abe4b 100644
--- a/pkg/database/password.go
+++ b/pkg/database/password.go
@@ -12,3 +12,11 @@ func hashPassword(password string) (string, error) {
}
return string(bytes), nil
}
+
+func checkPassword(hash string, password string) error {
+ err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password))
+ if err != nil {
+ return newPasswordError(err)
+ }
+ return nil
+}