Skip to content

Commit

Permalink
prevent password record with 2FA but without otpSecret
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrenn committed Mar 7, 2024
1 parent 5e1c30e commit 90c28c2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1906,7 +1906,11 @@ public static Password createPassword(boolean resetLogons, boolean resetOtpSecre
password.setShowOtpRegistrationInfo(false);
}
if (!resetOtpSecret && password.getOtpType() != null && lastPassword != null) {
resetOtpSecret = !password.getOtpType().equals(lastPassword.getOtpType());
if (lastPassword.getEncryptedOtpSecret() != null && lastPassword.getEncryptedOtpSecret().length > 0) {
resetOtpSecret = !password.getOtpType().equals(lastPassword.getOtpType());
} else {
resetOtpSecret = true;
}
}
if (resetOtpSecret) {
if (password.getOtpType() != null) {
Expand Down

0 comments on commit 90c28c2

Please sign in to comment.