@hexar/biometric-identity-sdk-react-native 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/BiometricIdentityFlow.d.ts.map +1 -1
- package/dist/components/BiometricIdentityFlow.js +11 -0
- package/dist/hooks/useBiometricSDK.d.ts.map +1 -1
- package/dist/hooks/useBiometricSDK.js +4 -0
- package/package.json +1 -1
- package/src/components/BiometricIdentityFlow.tsx +11 -0
- package/src/hooks/useBiometricSDK.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BiometricIdentityFlow.d.ts","sourceRoot":"","sources":["../../src/components/BiometricIdentityFlow.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAOL,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,cAAc,EAKd,iBAAiB,EAElB,MAAM,oCAAoC,CAAC;AAU5C,MAAM,WAAW,0BAA0B;IACzC,oBAAoB,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACzD,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,OAAO,CAAC,EAAE,SAAS,CAAC;KACrB,CAAC;CACH;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,
|
|
1
|
+
{"version":3,"file":"BiometricIdentityFlow.d.ts","sourceRoot":"","sources":["../../src/components/BiometricIdentityFlow.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAOL,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,cAAc,EAKd,iBAAiB,EAElB,MAAM,oCAAoC,CAAC;AAU5C,MAAM,WAAW,0BAA0B;IACzC,oBAAoB,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACzD,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,OAAO,CAAC,EAAE,SAAS,CAAC;KACrB,CAAC;CACH;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAyWtE,CAAC;AAiOF,eAAe,qBAAqB,CAAC"}
|
|
@@ -80,7 +80,9 @@ const BiometricIdentityFlow = ({ onValidationComplete, onError, theme, language,
|
|
|
80
80
|
const styles = createStyles(theme);
|
|
81
81
|
// Handle validation result - call callback when RESULT step is reached
|
|
82
82
|
(0, react_1.useEffect)(() => {
|
|
83
|
+
console.log('🔵 [BiometricIdentityFlow] useEffect triggered - currentStep:', state.currentStep, 'hasResult:', !!state.validationResult, 'hasCalled:', hasCalledValidationComplete.current);
|
|
83
84
|
if (state.currentStep === biometric_identity_sdk_core_1.SDKStep.RESULT && state.validationResult && !hasCalledValidationComplete.current) {
|
|
85
|
+
console.log('🟢 [BiometricIdentityFlow] Calling onValidationComplete callback');
|
|
84
86
|
biometric_identity_sdk_core_1.logger.info('Validation completed, calling onValidationComplete callback');
|
|
85
87
|
hasCalledValidationComplete.current = true;
|
|
86
88
|
// Use ref to avoid dependency issues
|
|
@@ -147,15 +149,24 @@ const BiometricIdentityFlow = ({ onValidationComplete, onError, theme, language,
|
|
|
147
149
|
challengesCompleted: videoResult.challengesCompleted,
|
|
148
150
|
sessionId: videoResult.sessionId,
|
|
149
151
|
});
|
|
152
|
+
console.log('🔵 [BiometricIdentityFlow] Video stored, starting validation...');
|
|
150
153
|
biometric_identity_sdk_core_1.logger.info('Starting validation...');
|
|
151
154
|
const result = await validateIdentity();
|
|
155
|
+
console.log('🟢 [BiometricIdentityFlow] Validation completed:', result);
|
|
152
156
|
biometric_identity_sdk_core_1.logger.info('Validation completed successfully:', result);
|
|
153
157
|
// Ensure state is synced after validation
|
|
154
158
|
// The state should be updated by validateIdentity, but we'll force a sync
|
|
155
159
|
const finalState = sdk.getState();
|
|
160
|
+
console.log('🔵 [BiometricIdentityFlow] Final state after validation:', JSON.stringify({
|
|
161
|
+
currentStep: finalState.currentStep,
|
|
162
|
+
hasResult: !!finalState.validationResult,
|
|
163
|
+
progress: finalState.progress,
|
|
164
|
+
isLoading: finalState.isLoading
|
|
165
|
+
}));
|
|
156
166
|
biometric_identity_sdk_core_1.logger.info('Final state after validation:', finalState);
|
|
157
167
|
// Backup: If we have a result but the useEffect didn't fire, call the callback directly
|
|
158
168
|
if (finalState.currentStep === biometric_identity_sdk_core_1.SDKStep.RESULT && finalState.validationResult && !hasCalledValidationComplete.current) {
|
|
169
|
+
console.log('🟢 [BiometricIdentityFlow] Backup: Calling onValidationComplete directly');
|
|
159
170
|
biometric_identity_sdk_core_1.logger.info('Backup: Calling onValidationComplete directly after validation');
|
|
160
171
|
hasCalledValidationComplete.current = true;
|
|
161
172
|
onValidationCompleteRef.current(finalState.validationResult);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBiometricSDK.d.ts","sourceRoot":"","sources":["../../src/hooks/useBiometricSDK.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,QAAQ,EACR,WAAW,EAGZ,MAAM,oCAAoC,CAAC;AAE5C,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,oBAAoB,CAAC;IAC1B,KAAK,EAAE,QAAQ,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,mBAAmB,EAAE,CAAC,SAAS,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,eAAe,EAAE,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,KAAK,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IAC7E,gBAAgB,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,WAAW,EAAE,CAAC,SAAS,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD;AAED,eAAO,MAAM,eAAe,QAAO,
|
|
1
|
+
{"version":3,"file":"useBiometricSDK.d.ts","sourceRoot":"","sources":["../../src/hooks/useBiometricSDK.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,QAAQ,EACR,WAAW,EAGZ,MAAM,oCAAoC,CAAC;AAE5C,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,oBAAoB,CAAC;IAC1B,KAAK,EAAE,QAAQ,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,mBAAmB,EAAE,CAAC,SAAS,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,eAAe,EAAE,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,KAAK,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IAC7E,gBAAgB,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,WAAW,EAAE,CAAC,SAAS,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD;AAED,eAAO,MAAM,eAAe,QAAO,qBAoQlC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -137,6 +137,7 @@ const useBiometricSDK = () => {
|
|
|
137
137
|
* Validate identity with all collected data
|
|
138
138
|
*/
|
|
139
139
|
const validateIdentity = (0, react_1.useCallback)(async () => {
|
|
140
|
+
console.log('🔵 [useBiometricSDK] validateIdentity called');
|
|
140
141
|
biometric_identity_sdk_core_1.logger.info('validateIdentity called, current state:', sdk.getState());
|
|
141
142
|
setState(sdk.getState());
|
|
142
143
|
const pollInterval = setInterval(() => {
|
|
@@ -146,7 +147,9 @@ const useBiometricSDK = () => {
|
|
|
146
147
|
}
|
|
147
148
|
}, 200);
|
|
148
149
|
try {
|
|
150
|
+
console.log('🔵 [useBiometricSDK] Calling sdk.validateIdentity()...');
|
|
149
151
|
const result = await sdk.validateIdentity();
|
|
152
|
+
console.log('🟢 [useBiometricSDK] sdk.validateIdentity() completed, result:', result);
|
|
150
153
|
// Keep polling for a bit to ensure we capture the RESULT state transition
|
|
151
154
|
// The SDK updates state synchronously, but we want to make sure React sees it
|
|
152
155
|
let pollCount = 0;
|
|
@@ -159,6 +162,7 @@ const useBiometricSDK = () => {
|
|
|
159
162
|
setState(currentState);
|
|
160
163
|
// Stop polling once we reach RESULT or ERROR state
|
|
161
164
|
if (currentState.currentStep === biometric_identity_sdk_core_1.SDKStep.RESULT || currentState.currentStep === biometric_identity_sdk_core_1.SDKStep.ERROR) {
|
|
165
|
+
console.log('🟢 [useBiometricSDK] Reached final state:', currentState.currentStep);
|
|
162
166
|
clearInterval(finalPollInterval);
|
|
163
167
|
clearInterval(pollInterval);
|
|
164
168
|
biometric_identity_sdk_core_1.logger.info('Reached final state, stopped polling:', currentState);
|
package/package.json
CHANGED
|
@@ -106,7 +106,9 @@ export const BiometricIdentityFlow: React.FC<BiometricIdentityFlowProps> = ({
|
|
|
106
106
|
|
|
107
107
|
// Handle validation result - call callback when RESULT step is reached
|
|
108
108
|
useEffect(() => {
|
|
109
|
+
console.log('🔵 [BiometricIdentityFlow] useEffect triggered - currentStep:', state.currentStep, 'hasResult:', !!state.validationResult, 'hasCalled:', hasCalledValidationComplete.current);
|
|
109
110
|
if (state.currentStep === SDKStep.RESULT && state.validationResult && !hasCalledValidationComplete.current) {
|
|
111
|
+
console.log('🟢 [BiometricIdentityFlow] Calling onValidationComplete callback');
|
|
110
112
|
logger.info('Validation completed, calling onValidationComplete callback');
|
|
111
113
|
hasCalledValidationComplete.current = true;
|
|
112
114
|
// Use ref to avoid dependency issues
|
|
@@ -178,17 +180,26 @@ export const BiometricIdentityFlow: React.FC<BiometricIdentityFlowProps> = ({
|
|
|
178
180
|
sessionId: videoResult.sessionId,
|
|
179
181
|
});
|
|
180
182
|
|
|
183
|
+
console.log('🔵 [BiometricIdentityFlow] Video stored, starting validation...');
|
|
181
184
|
logger.info('Starting validation...');
|
|
182
185
|
const result = await validateIdentity();
|
|
186
|
+
console.log('🟢 [BiometricIdentityFlow] Validation completed:', result);
|
|
183
187
|
logger.info('Validation completed successfully:', result);
|
|
184
188
|
|
|
185
189
|
// Ensure state is synced after validation
|
|
186
190
|
// The state should be updated by validateIdentity, but we'll force a sync
|
|
187
191
|
const finalState = sdk.getState();
|
|
192
|
+
console.log('🔵 [BiometricIdentityFlow] Final state after validation:', JSON.stringify({
|
|
193
|
+
currentStep: finalState.currentStep,
|
|
194
|
+
hasResult: !!finalState.validationResult,
|
|
195
|
+
progress: finalState.progress,
|
|
196
|
+
isLoading: finalState.isLoading
|
|
197
|
+
}));
|
|
188
198
|
logger.info('Final state after validation:', finalState);
|
|
189
199
|
|
|
190
200
|
// Backup: If we have a result but the useEffect didn't fire, call the callback directly
|
|
191
201
|
if (finalState.currentStep === SDKStep.RESULT && finalState.validationResult && !hasCalledValidationComplete.current) {
|
|
202
|
+
console.log('🟢 [BiometricIdentityFlow] Backup: Calling onValidationComplete directly');
|
|
192
203
|
logger.info('Backup: Calling onValidationComplete directly after validation');
|
|
193
204
|
hasCalledValidationComplete.current = true;
|
|
194
205
|
onValidationCompleteRef.current(finalState.validationResult);
|
|
@@ -194,6 +194,7 @@ export const useBiometricSDK = (): UseBiometricSDKResult => {
|
|
|
194
194
|
* Validate identity with all collected data
|
|
195
195
|
*/
|
|
196
196
|
const validateIdentity = useCallback(async () => {
|
|
197
|
+
console.log('🔵 [useBiometricSDK] validateIdentity called');
|
|
197
198
|
logger.info('validateIdentity called, current state:', sdk.getState());
|
|
198
199
|
setState(sdk.getState());
|
|
199
200
|
|
|
@@ -205,7 +206,9 @@ export const useBiometricSDK = (): UseBiometricSDKResult => {
|
|
|
205
206
|
}, 200);
|
|
206
207
|
|
|
207
208
|
try {
|
|
209
|
+
console.log('🔵 [useBiometricSDK] Calling sdk.validateIdentity()...');
|
|
208
210
|
const result = await sdk.validateIdentity();
|
|
211
|
+
console.log('🟢 [useBiometricSDK] sdk.validateIdentity() completed, result:', result);
|
|
209
212
|
|
|
210
213
|
// Keep polling for a bit to ensure we capture the RESULT state transition
|
|
211
214
|
// The SDK updates state synchronously, but we want to make sure React sees it
|
|
@@ -221,6 +224,7 @@ export const useBiometricSDK = (): UseBiometricSDKResult => {
|
|
|
221
224
|
|
|
222
225
|
// Stop polling once we reach RESULT or ERROR state
|
|
223
226
|
if (currentState.currentStep === SDKStep.RESULT || currentState.currentStep === SDKStep.ERROR) {
|
|
227
|
+
console.log('🟢 [useBiometricSDK] Reached final state:', currentState.currentStep);
|
|
224
228
|
clearInterval(finalPollInterval);
|
|
225
229
|
clearInterval(pollInterval);
|
|
226
230
|
logger.info('Reached final state, stopped polling:', currentState);
|