Skip to content

Commit

Permalink
更新 password_hash.go
Browse files Browse the repository at this point in the history
  • Loading branch information
wsczx authored Oct 29, 2024
1 parent dd7d1b0 commit ae6cd7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/pkg/utils/password_hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ func PasswordHash(password string) (string, error) {

func PasswordVerify(password, hash string) bool {
// 保留老用户明文验证
if len(hash) != 60 {
return password == hash
if password == hash {
return true
}
err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password))
return err == nil
Expand Down

0 comments on commit ae6cd7a

Please sign in to comment.