|
1 | 1 | ## Release Updates & Announcments:
|
| 2 | +* [fio.js V2.1 Released with Age Verification & Minors Access Prevention](https://blog.pixlab.io/2023/06/age-verification-check-available-for-faceio-face-recognition) |
2 | 3 | * Introducing the `fetchAllErrorCodes()` method for the NPM Package for much better error logging experience.
|
3 | 4 | * [New REST API Endpoints Available for FACEIO](https://blog.pixlab.io/2023/04/new-rest-api-endpoints-available-for-faceio)
|
4 | 5 | * [Liveness Detection & Face Anti-Spoofing Security Feature Available for FACEIO](https://www.biometricupdate.com/202303/pixlab-adds-active-liveness-detection-to-faceio-biometrics-framework)
|
@@ -57,7 +58,43 @@ async function authenticateUser(){
|
57 | 58 | // call to faceio.authenticate() here will automatically trigger the facial authentication process
|
58 | 59 | }
|
59 | 60 | function handleError(errCode){
|
60 |
| - // Handle error here |
| 61 | + // Handle error here |
| 62 | + // Log all possible error codes during user interaction.. |
| 63 | + // Refer to: https://faceio.net/integration-guide#error-codes |
| 64 | + // for a detailed overview when these errors are triggered. |
| 65 | + const fioErrCode = faceio.fetchAllErrorCodes(); |
| 66 | + switch (errCode) { |
| 67 | + case fioErrCode.PERMISSION_REFUSED: |
| 68 | + console.log("Access to the Camera stream was denied by the end user"); |
| 69 | + break; |
| 70 | + case fioErrCode.NO_FACES_DETECTED: |
| 71 | + console.log("No faces were detected during the enroll or authentication process"); |
| 72 | + break; |
| 73 | + case fioErrCode.UNRECOGNIZED_FACE: |
| 74 | + console.log("Unrecognized face on this application's Facial Index"); |
| 75 | + break; |
| 76 | + case fioErrCode.MANY_FACES: |
| 77 | + console.log("Two or more faces were detected during the scan process"); |
| 78 | + break; |
| 79 | + case fioErrCode.FACE_DUPLICATION: |
| 80 | + console.log("User enrolled previously (facial features already recorded). Cannot enroll again!"); |
| 81 | + break; |
| 82 | + case fioErrCode.MINORS_NOT_ALLOWED: |
| 83 | + console.log("Minors are not allowed to enroll on this application!"); |
| 84 | + break; |
| 85 | + case fioErrCode.PAD_ATTACK: |
| 86 | + console.log("Presentation (Spoof) Attack (PAD) detected during the scan process"); |
| 87 | + break; |
| 88 | + case fioErrCode.FACE_MISMATCH: |
| 89 | + console.log("Calculated Facial Vectors of the user being enrolled do not matches"); |
| 90 | + break; |
| 91 | + case fioErrCode.WRONG_PIN_CODE: |
| 92 | + console.log("Wrong PIN code supplied by the user being authenticated"); |
| 93 | + break; |
| 94 | + // ... |
| 95 | + // Refer to the boilerplate at: https://gist.github.com/symisc/34203d2811a39f2a871373abc6dd1ce9 |
| 96 | + // for the list of all possible error codes. |
| 97 | + } |
61 | 98 | }
|
62 | 99 |
|
63 | 100 | export default App;
|
|
0 commit comments