aboutsummaryrefslogtreecommitdiff
path: root/userapi/storage
diff options
context:
space:
mode:
Diffstat (limited to 'userapi/storage')
-rw-r--r--userapi/storage/shared/storage.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/userapi/storage/shared/storage.go b/userapi/storage/shared/storage.go
index 3ff299f1..09eeedc9 100644
--- a/userapi/storage/shared/storage.go
+++ b/userapi/storage/shared/storage.go
@@ -75,6 +75,9 @@ func (d *Database) GetAccountByPassword(
if err != nil {
return nil, err
}
+ if hash == "" {
+ return nil, bcrypt.ErrHashTooShort
+ }
if err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(plaintextPassword)); err != nil {
return nil, err
}