Commit f802075a authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Use errors.Is in Password.Match.

parent 90a0a2e3
......@@ -64,7 +64,7 @@ func (p Password) Match(pw string) (bool, error) {
return false, errors.New("missing key")
}
err := bcrypt.CompareHashAndPassword([]byte(*p.Key), []byte(pw))
if err == bcrypt.ErrMismatchedHashAndPassword {
if errors.Is(err, bcrypt.ErrMismatchedHashAndPassword) {
return false, nil
}
return err == nil, err
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment