Skip to content

Commit

Permalink
update: add LAErrorTouchIDLockout for iOS error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
langke committed Feb 17, 2019
1 parent e2a2f36 commit 3f7bc3c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ Format:
| `LAErrorPasscodeNotSet` | Authentication could not start because the passcode is not set on the device. |
| `LAErrorTouchIDNotAvailable` | Authentication could not start because Touch ID is not available on the device |
| `LAErrorTouchIDNotEnrolled` | Authentication could not start because Touch ID has no enrolled fingers. |
| `LAErrorTouchIDLockout` | Authentication failed because of too many failed attempts. |
| `RCTTouchIDUnknownError` | Could not authenticate for an unknown reason. |
| `RCTTouchIDNotSupported` | Device does not support Touch ID. |

Expand Down
4 changes: 4 additions & 0 deletions TouchID.m
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ - (NSString *)getErrorReason:(NSError *)error
case LAErrorTouchIDNotEnrolled:
errorReason = @"LAErrorTouchIDNotEnrolled";
break;

case LAErrorTouchIDLockout:
errorReason = @"LAErrorTouchIDLockout";
break;

default:
errorReason = @"RCTTouchIDUnknownError";
Expand Down
4 changes: 4 additions & 0 deletions data/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const codes = {
LAErrorPasscodeNotSet: 'LAErrorPasscodeNotSet',
LAErrorTouchIDNotAvailable: 'LAErrorTouchIDNotAvailable',
LAErrorTouchIDNotEnrolled: 'LAErrorTouchIDNotEnrolled',
LAErrorTouchIDLockout: 'LAErrorTouchIDLockout',
RCTTouchIDNotSupported: 'RCTTouchIDNotSupported',
RCTTouchIDUnknownError: 'RCTTouchIDUnknownError'
},
Expand Down Expand Up @@ -55,6 +56,9 @@ const iOSErrors = {
[codes.iOSCodes.LAErrorTouchIDNotEnrolled]: {
message: 'Authentication could not start because Touch ID has no enrolled fingers.'
},
[codes.iOSCodes.LAErrorTouchIDLockout]: {
message: 'Authentication failed because of too many failed attempts.'
},
[codes.iOSCodes.RCTTouchIDUnknownError]: {
message: 'Could not authenticate for an unknown reason.'
},
Expand Down
3 changes: 3 additions & 0 deletions errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ const getError = (code) => {
case codes.iOSCodes.LAErrorUserFallback:
return errors.USER_FALLBACK;

case codes.iOSCodes.LAErrorTouchIDLockout:
return errors.LOCKOUT;

default:
return errors.UNKNOWN_ERROR;
}
Expand Down

0 comments on commit 3f7bc3c

Please sign in to comment.