Return own error
This commit is contained in:
parent
558fddc139
commit
b0175542f1
@ -13,7 +13,12 @@ type Verifier struct {
|
|||||||
|
|
||||||
// Verify verifys a Password.
|
// Verify verifys a Password.
|
||||||
func (bv *Verifier) Verify(password string, hashOnDB string) error {
|
func (bv *Verifier) Verify(password string, hashOnDB string) error {
|
||||||
return bcrypt.CompareHashAndPassword([]byte(hashOnDB), []byte(password))
|
err := bcrypt.CompareHashAndPassword([]byte(hashOnDB), []byte(password))
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("verify password: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hash calculates a hash to be stored on the database.
|
// Hash calculates a hash to be stored on the database.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user