Skip to content

Commit

Permalink
len(s.src) == 0->len(s.src) == 0 || s.Error != nil
Browse files Browse the repository at this point in the history
  • Loading branch information
gouguoyin committed Jan 9, 2023
1 parent 8624987 commit 94c75d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bcrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ func (s Signer) ByBcrypt(rounds ...int) Signer {
// ByBcrypt verify by bcrypt.
// 通过 bcrypt 验签
func (v Verifier) ByBcrypt() Verifier {
if len(v.src) == 0 || v.Error != nil {
return v
}
v.Error = bcrypt.CompareHashAndPassword(interface2bytes(v.sign), v.src)
return v
}

0 comments on commit 94c75d2

Please sign in to comment.