[bug](user login)fix PASSWORD_LOCK_TIME setting UNBOUNDED does not take effect (#26585)

This commit is contained in:
Liqf
2023-11-13 10:41:49 +08:00
committed by GitHub
parent 7e36ab838f
commit db29850e1c

View File

@ -410,7 +410,8 @@ public class PasswordPolicy implements Writable {
}
if (lockTime.get() > 0 && passwordLockSeconds == UNBOUNDED) {
// unbounded lock
return 0;
// Returns 9999 seconds every time instead of 9999 seconds countdown
return 9999;
}
return Math.max(0, passwordLockSeconds - ((System.currentTimeMillis() - lockTime.get()) / 1000));
}