Skip to content

Commit

Permalink
fix: protection logic fix (#6484)
Browse files Browse the repository at this point in the history
  • Loading branch information
ezailWang authored Jan 10, 2025
1 parent b8ca8f4 commit 4a4fa2f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ const PasswordVerifyContainer = ({
let message = intl.formatMessage({
id: ETranslations.auth_error_password_incorrect,
});
let skipProtection = false;
if (isLock && enablePasswordErrorProtection) {
let nextAttempts = passwordErrorAttempts + 1;
if (!unlockPeriodPasswordArray.includes(finalPassword)) {
Expand All @@ -326,6 +327,7 @@ const PasswordVerifyContainer = ({
setUnlockPeriodPasswordArray((v) => [...v, finalPassword]);
} else {
nextAttempts = passwordErrorAttempts;
skipProtection = true;
}
if (nextAttempts >= PASSCODE_PROTECTION_ATTEMPTS) {
// reset app
Expand All @@ -344,7 +346,8 @@ const PasswordVerifyContainer = ({
}
}
} else if (
nextAttempts >= PASSCODE_PROTECTION_ATTEMPTS_MESSAGE_SHOW_MAX
nextAttempts >= PASSCODE_PROTECTION_ATTEMPTS_MESSAGE_SHOW_MAX &&
!skipProtection
) {
const timeMinutes =
PASSCODE_PROTECTION_ATTEMPTS_PER_MINUTE_MAP[
Expand Down

0 comments on commit 4a4fa2f

Please sign in to comment.