Skip to content

Commit

Permalink
fix: set minimum passcode length
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonella Sgarlatta committed Jul 1, 2021
1 parent ef108fe commit 1bb2750
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {
STRING_CONFIRM_APP_QUIT_DURING_PASSCODE_CHANGE,
STRING_CONFIRM_APP_QUIT_DURING_PASSCODE_REMOVAL, STRING_E2E_ENABLED, STRING_ENC_NOT_ENABLED, STRING_LOCAL_ENC_ENABLED,
STRING_NON_MATCHING_PASSCODES,
StringUtils
StringUtils,
Strings
} from '@/strings';
import { WebApplication } from '@/ui_models/application';
import { preventRefreshing } from '@/utils';
Expand Down Expand Up @@ -109,6 +110,12 @@ const PasscodeLock = observer(({
const submitPasscodeForm = async (event: TargetedEvent<HTMLFormElement> | TargetedMouseEvent<HTMLButtonElement>) => {
event.preventDefault();

if (!passcode || passcode.length === 0) {
await alertDialog({
text: Strings.enterPasscode,
});
}

if (passcode !== passcodeConfirmation) {
await alertDialog({
text: STRING_NON_MATCHING_PASSCODES
Expand Down

0 comments on commit 1bb2750

Please sign in to comment.