Skip to content

Commit

Permalink
Fix openMF#688: Login fails after entering correct passcode for the f…
Browse files Browse the repository at this point in the history
…ourth time after 3 wrong tries.
  • Loading branch information
AkshGautam committed Mar 19, 2018
1 parent a6d7ff4 commit 697b1e4
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -146,8 +146,9 @@ public void passCodeEntered(String passcode) {
passCodeView.clearPasscodeField();
return;
}

if (counter == 3) {
String passwordEntered = EncryptionUtil.getHash(passCodeView.getPasscode());
boolean isPassCodeCorrect = preferencesHelper.getPasscode().equals(passwordEntered);
if (counter == 3 && !isPassCodeCorrect) {
Toast.makeText(getApplicationContext(), R.string.incorrect_passcode_more_than_three,
Toast.LENGTH_SHORT).show();
preferencesHelper.clear();
Expand All @@ -156,8 +157,7 @@ public void passCodeEntered(String passcode) {
}

if (isPassCodeLengthCorrect()) {
String passwordEntered = EncryptionUtil.getHash(passCodeView.getPasscode());
if (preferencesHelper.getPasscode().equals(passwordEntered)) {
if (isPassCodeCorrect) {
BaseApiManager.createService(preferencesHelper.getBaseUrl(),
preferencesHelper.getTenant(), preferencesHelper.getToken());
startHomeActivity();
Expand Down

0 comments on commit 697b1e4

Please sign in to comment.