mirror of
https://github.com/jech/galene.git
synced 2024-11-22 08:35:57 +01:00
Use errors.Is in Password.Match.
This commit is contained in:
parent
90a0a2e318
commit
f802075aa8
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ func (p Password) Match(pw string) (bool, error) {
|
||||||
return false, errors.New("missing key")
|
return false, errors.New("missing key")
|
||||||
}
|
}
|
||||||
err := bcrypt.CompareHashAndPassword([]byte(*p.Key), []byte(pw))
|
err := bcrypt.CompareHashAndPassword([]byte(*p.Key), []byte(pw))
|
||||||
if err == bcrypt.ErrMismatchedHashAndPassword {
|
if errors.Is(err, bcrypt.ErrMismatchedHashAndPassword) {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
return err == nil, err
|
return err == nil, err
|
||||||
|
|
Loading…
Reference in a new issue