Skip to content

Commit

Permalink
Apple: #495: Test for already locked out biometry
Browse files Browse the repository at this point in the history
  • Loading branch information
hvge committed Nov 3, 2022
1 parent 26ec65d commit 3ca11df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions proj-xcode/PowerAuth2/PowerAuthSDK.m
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,13 @@ - (void) authenticateUsingBiometryImpl:(PowerAuthKeychainAuthentication *)keycha
return;
}

// Check biometric status in advance, do do not increase failed attempts counter
// in case that biometry is already locked out.
if (![PowerAuthKeychain canUseBiometricAuthentication]) {
callback(nil, PA2MakeError(PowerAuthErrorCode_BiometryNotAvailable, nil));
return;
}

// Use app provided, or create a new LAContext if "prompt" variant is used.
NSString * prompt = keychainAuthentication.prompt;
LAContext * context = keychainAuthentication.context;
Expand Down

0 comments on commit 3ca11df

Please sign in to comment.