gbc-kyc-kit 1.5.0 → 1.5.2
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/gbc-kyc-kit.es.js
CHANGED
|
@@ -18784,7 +18784,7 @@ var lib$1 = isEmpty$2;
|
|
|
18784
18784
|
function useGeolocation() {
|
|
18785
18785
|
const [geolocation, setGeolocation] = useState(null);
|
|
18786
18786
|
useEffect(() => {
|
|
18787
|
-
fetch("
|
|
18787
|
+
fetch("https://ipapi.co/json").then((res) => res.json()).then((res) => setGeolocation(res)).catch((error) => console.log(error));
|
|
18788
18788
|
}, []);
|
|
18789
18789
|
return geolocation;
|
|
18790
18790
|
}
|
|
@@ -18798,13 +18798,13 @@ const BlackListController = (clientId, authorize, inProduction, countryCodeAllow
|
|
|
18798
18798
|
const [countryCode, setCountryCode] = useState(null);
|
|
18799
18799
|
const geolocation = useGeolocation();
|
|
18800
18800
|
useEffect(() => {
|
|
18801
|
-
countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.countryCode);
|
|
18802
18801
|
if (countryCodeAllowed && geolocation) {
|
|
18803
|
-
if (!countryCodeAllowed.includes(geolocation == null ? void 0 : geolocation.
|
|
18802
|
+
if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.includes(geolocation == null ? void 0 : geolocation.country_code)) {
|
|
18804
18803
|
setStatus("COUNTRY_NOT_ALLOWED");
|
|
18805
18804
|
setMessage("Pa\xEDs no autorizado");
|
|
18806
18805
|
}
|
|
18807
18806
|
}
|
|
18807
|
+
countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.country_code);
|
|
18808
18808
|
}, [geolocation, countryCodeAllowed]);
|
|
18809
18809
|
const clearState = () => {
|
|
18810
18810
|
reset();
|
|
@@ -20320,13 +20320,13 @@ const DocumentReaderController = (dataDocument, clientId, authorize, inProductio
|
|
|
20320
20320
|
const [countryCode, setCountryCode] = useState(null);
|
|
20321
20321
|
const geolocation = useGeolocation();
|
|
20322
20322
|
useEffect(() => {
|
|
20323
|
-
countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.countryCode);
|
|
20324
20323
|
if (countryCodeAllowed && geolocation) {
|
|
20325
|
-
if (!countryCodeAllowed.includes(geolocation == null ? void 0 : geolocation.
|
|
20324
|
+
if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.includes(geolocation == null ? void 0 : geolocation.country_code)) {
|
|
20326
20325
|
setStatus("COUNTRY_NOT_ALLOWED");
|
|
20327
20326
|
setMessage("Pa\xEDs no autorizado");
|
|
20328
20327
|
}
|
|
20329
20328
|
}
|
|
20329
|
+
countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.country_code);
|
|
20330
20330
|
}, [geolocation, countryCodeAllowed]);
|
|
20331
20331
|
const clearState = () => {
|
|
20332
20332
|
setDocImage({});
|
|
@@ -20603,13 +20603,13 @@ const FaceMatchController = (dataFaceMatch, clientId, authorize, inProduction, p
|
|
|
20603
20603
|
setUrl(imageSrc);
|
|
20604
20604
|
}, [webcamRef]);
|
|
20605
20605
|
useEffect(() => {
|
|
20606
|
-
countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.countryCode);
|
|
20607
20606
|
if (countryCodeAllowed && geolocation) {
|
|
20608
|
-
if (!countryCodeAllowed.includes(geolocation == null ? void 0 : geolocation.
|
|
20607
|
+
if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.includes(geolocation == null ? void 0 : geolocation.country_code)) {
|
|
20609
20608
|
setStatus("COUNTRY_NOT_ALLOWED");
|
|
20610
20609
|
setMessage("Pa\xEDs no autorizado");
|
|
20611
20610
|
}
|
|
20612
20611
|
}
|
|
20612
|
+
countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.country_code);
|
|
20613
20613
|
}, [geolocation, countryCodeAllowed]);
|
|
20614
20614
|
const clearState = () => {
|
|
20615
20615
|
setDocImage({});
|
|
@@ -24673,13 +24673,13 @@ const LivenessCheckController = (clientId, authorize, inProduction, countryCodeA
|
|
|
24673
24673
|
}
|
|
24674
24674
|
};
|
|
24675
24675
|
useEffect(() => {
|
|
24676
|
-
countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.countryCode);
|
|
24677
24676
|
if (countryCodeAllowed && geolocation) {
|
|
24678
|
-
if (!countryCodeAllowed.includes(geolocation == null ? void 0 : geolocation.
|
|
24677
|
+
if (countryCodeAllowed.length !== 0 && !countryCodeAllowed.includes(geolocation == null ? void 0 : geolocation.country_code)) {
|
|
24679
24678
|
setStatus("COUNTRY_NOT_ALLOWED");
|
|
24680
24679
|
setMessage("Pa\xEDs no autorizado");
|
|
24681
24680
|
}
|
|
24682
24681
|
}
|
|
24682
|
+
countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.country_code);
|
|
24683
24683
|
}, [geolocation, countryCodeAllowed]);
|
|
24684
24684
|
const clearState = () => {
|
|
24685
24685
|
setStatus("");
|