This commit is contained in:
Mike Schwörer 2022-12-23 14:47:16 +01:00
parent 7f88a0726c
commit 10ddc7c190
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF

View File

@ -150,9 +150,9 @@ func (ph PassHash) Verify(plainpass string, totp *string) bool {
if version == 4 { if version == 4 {
if !hastotp { if !hastotp {
return bcrypt.CompareHashAndPassword(payload, []byte(plainpass)) != nil return bcrypt.CompareHashAndPassword(payload, []byte(plainpass)) == nil
} else { } else {
return bcrypt.CompareHashAndPassword(payload, []byte(plainpass)) != nil && totpext.Validate(totpsecret, *totp) return bcrypt.CompareHashAndPassword(payload, []byte(plainpass)) == nil && totpext.Validate(totpsecret, *totp)
} }
} }