From 478ff9f1817b8c4e81d5f3c88bce5f19c682999a Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Mon, 27 Apr 2020 09:34:56 -0300 Subject: [PATCH] Reset attempts and save last authentication on local passcode confirmation --- app/utils/localAuthentication.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/utils/localAuthentication.js b/app/utils/localAuthentication.js index a0a151603..78a1a3149 100644 --- a/app/utils/localAuthentication.js +++ b/app/utils/localAuthentication.js @@ -71,10 +71,7 @@ export const localAuthenticate = async(server) => { } catch (e) { // Do nothing } - if (authResult?.success) { - await resetAttempts(); - await saveLastLocalAuthenticationSession(server, serverRecord); - } else { + if (!authResult?.success) { await localPasscode(); } } else { @@ -83,6 +80,10 @@ export const localAuthenticate = async(server) => { } else { await localPasscode(); } + + // + await resetAttempts(); + await saveLastLocalAuthenticationSession(server, serverRecord); } } };