@bytexbyte/berifyme-react-sdk 1.0.15 → 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/BerifymeModal/index.js +18 -10
- package/dist/api/api.js +31 -6
- package/dist/components/AllSet/index.js +33 -37
- package/dist/components/Login/authid/authid.js +26 -17
- package/dist/components/Login/authid/index.js +1 -6
- package/dist/components/Login/clearAllSet.js +2 -6
- package/dist/components/Login/incode/Login.js +3 -3
- package/dist/components/Login/sumsub/index.js +5 -5
- package/dist/components/Login/veriff/Login.js +2 -2
- package/dist/components/Login/veriff/index.js +2 -2
- package/dist/components/Login/yoti/Login.js +6 -6
- package/dist/components/Login/yoti/index.js +2 -2
- package/dist/components/OnBoarding/authId/index.js +29 -15
- package/dist/components/OnBoarding/clear/clearAllSet.js +2 -6
- package/dist/components/OnBoarding/incode/index.js +35 -26
- package/dist/components/OnBoarding/incode/processGlobalWatchlist.js +79 -0
- package/dist/components/OnBoarding/sumsub/index.js +4 -4
- package/dist/components/OnBoarding/vender/grid/authIdGrid.js +1 -1
- package/dist/components/OnBoarding/vender/grid/clearGrid.js +1 -1
- package/dist/components/OnBoarding/vender/grid/incodeGrid.js +1 -1
- package/dist/components/OnBoarding/vender/grid/sumsubGrid.js +1 -1
- package/dist/components/OnBoarding/vender/grid/veriffGrid.js +1 -1
- package/dist/components/OnBoarding/vender/grid/yotiGrid.js +1 -1
- package/dist/components/OnBoarding/yoti/OnBoarding.js +6 -6
- package/dist/components/OnBoarding/yoti/index.js +2 -2
- package/dist/components/QrcodeExpired.js +1 -1
- package/dist/components/SendSns/index.js +22 -19
- package/dist/components/SessionInterrupted.js +1 -1
- package/dist/components/SomethingWrong.js +41 -0
- package/dist/components/VerifyWithPhoneNumber/NewUser/index.js +4 -4
- package/dist/components/VerifyWithPhoneNumber/User/index.js +1 -1
- package/dist/types/api/api.d.ts +13 -1
- package/dist/types/components/AllSet/index.d.ts +2 -1
- package/dist/types/components/Login/authid/authid.d.ts +1 -1
- package/dist/types/components/Login/authid/index.d.ts +1 -0
- package/dist/types/components/Login/clearAllSet.d.ts +1 -0
- package/dist/types/components/OnBoarding/clear/clearAllSet.d.ts +1 -0
- package/dist/types/components/OnBoarding/incode/index.d.ts +1 -0
- package/dist/types/components/OnBoarding/incode/processGlobalWatchlist.d.ts +12 -0
- package/dist/types/components/SomethingWrong.d.ts +7 -0
- package/dist/types/vender/incode/incode.d.ts +1 -0
- package/package.json +1 -1
|
@@ -62,6 +62,7 @@ var AuthID = function (_a) {
|
|
|
62
62
|
var _c = useState(''), url = _c[0], setUrl = _c[1];
|
|
63
63
|
var _d = useState(false), showIdOrPassport = _d[0], setShowIdOrPassport = _d[1];
|
|
64
64
|
var docErrorCount = useRef(0);
|
|
65
|
+
var authIdInit = useRef(false);
|
|
65
66
|
var stopSpeedTest = useSpeedTest().stopSpeedTest;
|
|
66
67
|
useEffect(function () { stopSpeedTest(); }, []);
|
|
67
68
|
//第零部 準備URL
|
|
@@ -277,9 +278,23 @@ var AuthID = function (_a) {
|
|
|
277
278
|
if (selectedIdType !== '')
|
|
278
279
|
proofUser();
|
|
279
280
|
}, [selectedIdType]);
|
|
281
|
+
var handleClose = function () {
|
|
282
|
+
docErrorCount.current = 0;
|
|
283
|
+
setShowIdOrPassport(false);
|
|
284
|
+
};
|
|
280
285
|
useEffect(function () {
|
|
281
286
|
if (url) {
|
|
287
|
+
// 設定一個計時器,假設 10 秒內未收到 init 事件就算失敗
|
|
288
|
+
setTimeout(function () {
|
|
289
|
+
if (!authIdInit.current) {
|
|
290
|
+
setError('Try again later or choose a different verification provider to proceed.');
|
|
291
|
+
}
|
|
292
|
+
}, 6000); // 6 秒超時,可以根據需求調整
|
|
282
293
|
window.addEventListener('message', function (e) {
|
|
294
|
+
console.log('Listener message: ', e.data);
|
|
295
|
+
if (e.data.type === 'authid:init') {
|
|
296
|
+
authIdInit.current = true; // 初始化成功
|
|
297
|
+
}
|
|
283
298
|
if (e.data.type === 'authid:page') {
|
|
284
299
|
console.log(e.data);
|
|
285
300
|
if (e.data.pageName === 'verifiedPage') {
|
|
@@ -307,25 +322,24 @@ var AuthID = function (_a) {
|
|
|
307
322
|
console.log('remove message', e.data);
|
|
308
323
|
});
|
|
309
324
|
};
|
|
310
|
-
}, [url]);
|
|
325
|
+
}, [url, authIdInit.current]);
|
|
311
326
|
useEffect(function () {
|
|
312
327
|
console.log('error count: ', docErrorCount.current);
|
|
313
328
|
}, [docErrorCount.current]);
|
|
314
|
-
var handleClose = function () {
|
|
315
|
-
docErrorCount.current = 0;
|
|
316
|
-
setShowIdOrPassport(false);
|
|
317
|
-
};
|
|
318
329
|
return (React.createElement(React.Fragment, null,
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
330
|
+
React.createElement(Box, { sx: {
|
|
331
|
+
display: 'flex',
|
|
332
|
+
justifyContent: 'center',
|
|
333
|
+
alignItems: 'center',
|
|
334
|
+
position: 'absolute',
|
|
335
|
+
top: 0,
|
|
336
|
+
left: 0,
|
|
337
|
+
width: '100%',
|
|
338
|
+
height: '100%',
|
|
339
|
+
background: 'rgba(255, 255, 255, 0.8)' // 半透明背景
|
|
340
|
+
} },
|
|
341
|
+
React.createElement(CircularProgress, null)),
|
|
342
|
+
url && React.createElement(AuthIDComponent, { url: url, webauth: true }),
|
|
329
343
|
showIdOrPassport &&
|
|
330
344
|
React.createElement(Box, { sx: {
|
|
331
345
|
position: 'fixed',
|
|
@@ -39,13 +39,11 @@ import { useEffect, useState } from "react";
|
|
|
39
39
|
import berifymeApi, { VerificationStatus } from "../../../api/api";
|
|
40
40
|
import { Box, CircularProgress } from "@mui/material";
|
|
41
41
|
import AllSet from "../../AllSet";
|
|
42
|
-
import TryAgain from "../../TryAgain";
|
|
43
42
|
import { updateAuthenticationLog } from "../../AuthenticationLogs";
|
|
44
43
|
import { createDeveloperLog } from "../../createDeveloperLog";
|
|
45
44
|
var ClearOnboardingAllSet = function (_a) {
|
|
46
|
-
var token = _a.token, desktopRedirectUrlId = _a.desktopRedirectUrlId, setPageStatus = _a.setPageStatus;
|
|
45
|
+
var token = _a.token, desktopRedirectUrlId = _a.desktopRedirectUrlId, setPageStatus = _a.setPageStatus, setError = _a.setError;
|
|
47
46
|
var _b = useState(), user = _b[0], setUser = _b[1]; // berifyme user
|
|
48
|
-
var _c = useState(), error = _c[0], setError = _c[1];
|
|
49
47
|
var approve = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
50
48
|
var approveRes, res;
|
|
51
49
|
var id = _b.id, sessionId = _b.sessionId, token = _b.token;
|
|
@@ -106,9 +104,7 @@ var ClearOnboardingAllSet = function (_a) {
|
|
|
106
104
|
return;
|
|
107
105
|
approve({ id: res.clearOnboardingCallbackUserId, sessionId: sessionId, token: token });
|
|
108
106
|
}, [token]);
|
|
109
|
-
|
|
110
|
-
return (React.createElement(TryAgain, { message: error }));
|
|
111
|
-
return (React.createElement(React.Fragment, null, user ? React.createElement(AllSet, { user: user, token: token, desktopRedirectUrlId: desktopRedirectUrlId, setPageStatus: setPageStatus }) :
|
|
107
|
+
return (React.createElement(React.Fragment, null, user ? React.createElement(AllSet, { user: user, token: token, desktopRedirectUrlId: desktopRedirectUrlId, setPageStatus: setPageStatus, setError: setError }) :
|
|
112
108
|
React.createElement(Box, { sx: {
|
|
113
109
|
display: 'flex',
|
|
114
110
|
justifyContent: 'center',
|
|
@@ -47,38 +47,37 @@ import { FinishOnboarding } from "./FinishOnboarding";
|
|
|
47
47
|
import SelectType from "./SelectType";
|
|
48
48
|
import { Passport } from "./Passport";
|
|
49
49
|
import { Box, CircularProgress } from "@mui/material";
|
|
50
|
-
import TryAgain from "../../TryAgain";
|
|
51
50
|
import berifymeApi, { ActionType } from "../../../api/api";
|
|
52
51
|
import { createAuthenticationLog, updateAuthenticationLog } from "../../AuthenticationLogs";
|
|
53
52
|
import { createDeveloperLog } from "../../createDeveloperLog";
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
import { ProcessGlobalWatchlist } from "./processGlobalWatchlist";
|
|
54
|
+
function startOnboardingSession(_a) {
|
|
55
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
56
56
|
var res;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
var uniqueId = _b.uniqueId, sessionToken = _b.sessionToken;
|
|
58
|
+
return __generator(this, function (_c) {
|
|
59
|
+
switch (_c.label) {
|
|
60
|
+
case 0: return [4 /*yield*/, berifymeApi.incode.getIncodeStart({ uniqueId: uniqueId, sessionToken: sessionToken })];
|
|
60
61
|
case 1:
|
|
61
|
-
res =
|
|
62
|
+
res = _c.sent();
|
|
62
63
|
return [2 /*return*/, res];
|
|
63
64
|
}
|
|
64
65
|
});
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
68
|
var IncodeOnBoarding = function (_a) {
|
|
68
|
-
var user = _a.user, setUser = _a.setUser, goToAllSet = _a.goToAllSet, token = _a.token;
|
|
69
|
+
var user = _a.user, setUser = _a.setUser, goToAllSet = _a.goToAllSet, token = _a.token, setError = _a.setError;
|
|
69
70
|
var _b = useState(0), step = _b[0], setStep = _b[1]; // Store the current step
|
|
70
|
-
var _c = useState(
|
|
71
|
-
var _d = useState(null), session = _d[0], setSession = _d[1]; // Stores the Session
|
|
71
|
+
var _c = useState(null), session = _c[0], setSession = _c[1]; // Stores the Session
|
|
72
72
|
var isLoaded = useRef(false);
|
|
73
73
|
function finishIncodeOnboarding(id, token, sessionToken) {
|
|
74
74
|
return __awaiter(this, void 0, void 0, function () {
|
|
75
|
-
var incodeRes;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
switch (_b.label) {
|
|
75
|
+
var incodeRes, returnBoolean;
|
|
76
|
+
return __generator(this, function (_a) {
|
|
77
|
+
switch (_a.label) {
|
|
79
78
|
case 0: return [4 /*yield*/, berifymeApi.incode.getIncodeFinish({ token: token })];
|
|
80
79
|
case 1:
|
|
81
|
-
|
|
80
|
+
_a.sent();
|
|
82
81
|
createDeveloperLog({
|
|
83
82
|
userId: user === null || user === void 0 ? void 0 : user.id,
|
|
84
83
|
userDataJson: user,
|
|
@@ -88,21 +87,24 @@ var IncodeOnBoarding = function (_a) {
|
|
|
88
87
|
});
|
|
89
88
|
return [4 /*yield*/, berifymeApi.incode.getIncodeApprove({ id: id, token: token, sessionToken: sessionToken })];
|
|
90
89
|
case 2:
|
|
91
|
-
incodeRes =
|
|
90
|
+
incodeRes = _a.sent();
|
|
92
91
|
if (incodeRes.error || !incodeRes.user) {
|
|
93
|
-
setError(
|
|
94
|
-
|
|
92
|
+
setError('');
|
|
93
|
+
returnBoolean = false;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
setUser(incodeRes.user);
|
|
97
|
+
returnBoolean = true;
|
|
95
98
|
}
|
|
96
|
-
setUser(incodeRes.user);
|
|
97
99
|
createDeveloperLog({
|
|
98
100
|
userId: user === null || user === void 0 ? void 0 : user.id,
|
|
99
101
|
userDataJson: user,
|
|
100
102
|
source: 'FRONTEND',
|
|
101
103
|
action: 'incode getIncodeApprove',
|
|
102
104
|
sessionToken: token,
|
|
103
|
-
firstDetail: "incode user: ".concat(incodeRes.user, ", error: ").concat(incodeRes.error)
|
|
105
|
+
firstDetail: "incode user: ".concat(incodeRes === null || incodeRes === void 0 ? void 0 : incodeRes.user, ", error: ").concat(incodeRes === null || incodeRes === void 0 ? void 0 : incodeRes.error)
|
|
104
106
|
});
|
|
105
|
-
return [2 /*return*/,
|
|
107
|
+
return [2 /*return*/, returnBoolean];
|
|
106
108
|
}
|
|
107
109
|
});
|
|
108
110
|
});
|
|
@@ -117,7 +119,7 @@ var IncodeOnBoarding = function (_a) {
|
|
|
117
119
|
if (isLoaded.current)
|
|
118
120
|
return;
|
|
119
121
|
var res = getUrlParams();
|
|
120
|
-
startOnboardingSession(res.uniqueId)
|
|
122
|
+
startOnboardingSession({ uniqueId: res.uniqueId, sessionToken: token })
|
|
121
123
|
.then(function (session) { return __awaiter(void 0, void 0, void 0, function () {
|
|
122
124
|
return __generator(this, function (_a) {
|
|
123
125
|
setSession(session);
|
|
@@ -187,7 +189,7 @@ var IncodeOnBoarding = function (_a) {
|
|
|
187
189
|
});
|
|
188
190
|
}
|
|
189
191
|
else
|
|
190
|
-
setError('
|
|
192
|
+
setError('');
|
|
191
193
|
_a.label = 2;
|
|
192
194
|
case 2: return [2 /*return*/];
|
|
193
195
|
}
|
|
@@ -195,10 +197,16 @@ var IncodeOnBoarding = function (_a) {
|
|
|
195
197
|
});
|
|
196
198
|
}
|
|
197
199
|
function handleError(e) {
|
|
198
|
-
|
|
200
|
+
createDeveloperLog({
|
|
201
|
+
userId: user === null || user === void 0 ? void 0 : user.id,
|
|
202
|
+
userDataJson: user,
|
|
203
|
+
source: 'FRONTEND',
|
|
204
|
+
action: 'incode handleError',
|
|
205
|
+
sessionToken: token,
|
|
206
|
+
firstDetail: "error: ".concat(e.type)
|
|
207
|
+
});
|
|
208
|
+
setError('');
|
|
199
209
|
}
|
|
200
|
-
if (error)
|
|
201
|
-
return (React.createElement(TryAgain, null));
|
|
202
210
|
if (!session)
|
|
203
211
|
return (React.createElement(Box, { sx: {
|
|
204
212
|
display: 'flex',
|
|
@@ -217,6 +225,7 @@ var IncodeOnBoarding = function (_a) {
|
|
|
217
225
|
React.createElement(ProcessId, { session: session, onError: handleError, onSuccess: goNext }),
|
|
218
226
|
React.createElement(Selfie, { session: session, onError: handleError, onSuccess: goNext }),
|
|
219
227
|
React.createElement(ProcessFace, { session: session, onError: handleError, onSuccess: goNext }),
|
|
228
|
+
React.createElement(ProcessGlobalWatchlist, { session: session, onError: handleError, onSuccess: goNext, token: token }),
|
|
220
229
|
React.createElement(FinishOnboarding, { session: session, onError: handleError, onSuccess: finishOnboarding }))));
|
|
221
230
|
};
|
|
222
231
|
export { IncodeOnBoarding };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { useEffect } from "react";
|
|
38
|
+
import { incode } from "../../../vender/incode/incode";
|
|
39
|
+
import { Box, CircularProgress } from "@mui/material";
|
|
40
|
+
import React from "react";
|
|
41
|
+
import berifymeApi from "../../../api/api";
|
|
42
|
+
function ProcessGlobalWatchlist(_a) {
|
|
43
|
+
var _this = this;
|
|
44
|
+
var session = _a.session, onSuccess = _a.onSuccess, onError = _a.onError, token = _a.token;
|
|
45
|
+
useEffect(function () {
|
|
46
|
+
if (session.watchList === false) {
|
|
47
|
+
onSuccess();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
void incode.processGlobalWatchlist({ token: session.token }).then(function (info) {
|
|
51
|
+
console.log('processGlobalWatchlist success e: ', info);
|
|
52
|
+
onSuccess();
|
|
53
|
+
}).catch(function (error) {
|
|
54
|
+
console.log('processGlobalWatchlist error e: ', error);
|
|
55
|
+
onError({ type: error });
|
|
56
|
+
}).finally(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
57
|
+
return __generator(this, function (_a) {
|
|
58
|
+
switch (_a.label) {
|
|
59
|
+
case 0:
|
|
60
|
+
if (!token)
|
|
61
|
+
return [2 /*return*/];
|
|
62
|
+
return [4 /*yield*/, berifymeApi.incode.incodeWatchListResult({ incodeSessionToken: session.token, berifymeSessionToken: token, incodeSessionId: session.interviewId })];
|
|
63
|
+
case 1:
|
|
64
|
+
_a.sent();
|
|
65
|
+
return [2 /*return*/];
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}); });
|
|
69
|
+
}, [session, onSuccess, onError]);
|
|
70
|
+
return React.createElement(Box, { sx: {
|
|
71
|
+
display: 'flex',
|
|
72
|
+
justifyContent: 'center',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
height: '100vh',
|
|
75
|
+
background: '#FFFFFF'
|
|
76
|
+
} },
|
|
77
|
+
React.createElement(CircularProgress, null));
|
|
78
|
+
}
|
|
79
|
+
export { ProcessGlobalWatchlist };
|
|
@@ -39,7 +39,7 @@ import React, { useCallback, useEffect, useState } from 'react';
|
|
|
39
39
|
import berifymeApi from '../../../api/api';
|
|
40
40
|
import { delay } from '../../../common';
|
|
41
41
|
import { createDeveloperLog } from '../../createDeveloperLog';
|
|
42
|
-
import
|
|
42
|
+
import SomethingWrong from '../../SomethingWrong';
|
|
43
43
|
var RETRY_INTERVAL = 1000 * 5;
|
|
44
44
|
var SumsubOnBoarding = function (_a) {
|
|
45
45
|
var user = _a.user, setUser = _a.setUser, goToAllSet = _a.goToAllSet, token = _a.token;
|
|
@@ -111,7 +111,7 @@ var SumsubOnBoarding = function (_a) {
|
|
|
111
111
|
_a.sent();
|
|
112
112
|
return [3 /*break*/, 6];
|
|
113
113
|
case 4:
|
|
114
|
-
setError('
|
|
114
|
+
setError('Something went wrong, but we’re working on it. Please try again later or contact support for assistance.');
|
|
115
115
|
return [2 /*return*/];
|
|
116
116
|
case 5:
|
|
117
117
|
if (approveResponse.sumsubId)
|
|
@@ -133,7 +133,7 @@ var SumsubOnBoarding = function (_a) {
|
|
|
133
133
|
secondDetail: JSON.stringify(userResponse),
|
|
134
134
|
});
|
|
135
135
|
if ('error' in userResponse) {
|
|
136
|
-
setError('
|
|
136
|
+
setError('Something went wrong, but we’re working on it. Please try again later or contact support for assistance.');
|
|
137
137
|
return [2 /*return*/];
|
|
138
138
|
}
|
|
139
139
|
setUser(userResponse.user);
|
|
@@ -176,7 +176,7 @@ var SumsubOnBoarding = function (_a) {
|
|
|
176
176
|
initAccessToken();
|
|
177
177
|
}, [initAccessToken]);
|
|
178
178
|
if (error || !token)
|
|
179
|
-
return (React.createElement(
|
|
179
|
+
return (React.createElement(SomethingWrong, { message: error }));
|
|
180
180
|
return (React.createElement(React.Fragment, null, accessToken &&
|
|
181
181
|
React.createElement(SumsubWebSdk, { accessToken: accessToken, expirationHandler: accessTokenExpirationHandler, options: { addViewportTag: false, adaptIframeHeight: true }, config: { theme: 'light' }, onMessage: messageHandler, onError: errorHandler })));
|
|
182
182
|
};
|
|
@@ -87,7 +87,7 @@ var AuthIdGrid = function (_a) {
|
|
|
87
87
|
});
|
|
88
88
|
}); } },
|
|
89
89
|
React.createElement(Stack, { width: 1, spacing: 1, px: 2, py: 2, bgcolor: theme.palette.grey[100], borderRadius: 6, alignItems: 'center' },
|
|
90
|
-
React.createElement("img", { width: 36, height: 36, src: "https://
|
|
90
|
+
React.createElement("img", { width: 36, height: 36, src: "https://idv.berify.me/berify-title.webp", alt: "berify-title.webp" }),
|
|
91
91
|
React.createElement(Typography, { variant: 'h5', fontWeight: 700, color: 'black' }, "Berify.me"),
|
|
92
92
|
React.createElement(Typography, { variant: 'body2', color: theme.palette.info.light, fontStyle: 'italic' }, "avg. 26s completion"))))));
|
|
93
93
|
};
|
|
@@ -7,7 +7,7 @@ var ClearGrid = function (_a) {
|
|
|
7
7
|
React.createElement(Grid, { item: true, xs: 6 },
|
|
8
8
|
React.createElement(Button, { fullWidth: true, onClick: function () { setPageStatus(2.1); } },
|
|
9
9
|
React.createElement(Stack, { width: 1, spacing: 1, px: 2, py: 2, bgcolor: theme.palette.grey[100], borderRadius: 6, alignItems: 'center' },
|
|
10
|
-
React.createElement("img", { width: 36, height: 36, src: "https://
|
|
10
|
+
React.createElement("img", { width: 36, height: 36, src: "https://idv.berify.me/clearme.svg", alt: "clearme.svg" }),
|
|
11
11
|
React.createElement(Typography, { variant: 'h5', fontWeight: 700, color: 'black' }, "CLEAR"),
|
|
12
12
|
React.createElement(Typography, { variant: 'body2', color: theme.palette.info.light, fontStyle: 'italic' }, "avg. 60s completion"))))));
|
|
13
13
|
};
|
|
@@ -7,7 +7,7 @@ var IncodeGrid = function (_a) {
|
|
|
7
7
|
React.createElement(Grid, { item: true, xs: 6 },
|
|
8
8
|
React.createElement(Button, { fullWidth: true, onClick: function () { setPageStatus(2.2); } },
|
|
9
9
|
React.createElement(Stack, { width: 1, spacing: 1, px: 2, py: 2, bgcolor: theme.palette.grey[100], borderRadius: 6, alignItems: 'center' },
|
|
10
|
-
React.createElement("img", { width: 36, height: 36, src: "https://
|
|
10
|
+
React.createElement("img", { width: 36, height: 36, src: "https://idv.berify.me/incode.svg", alt: "incode.svg" }),
|
|
11
11
|
React.createElement(Typography, { variant: 'h5', fontWeight: 700, color: 'black' }, "Incode"),
|
|
12
12
|
React.createElement(Typography, { variant: 'body2', color: theme.palette.info.light, fontStyle: 'italic' }, "avg. 30s completion"))))));
|
|
13
13
|
};
|
|
@@ -7,7 +7,7 @@ var SumsubGrid = function (_a) {
|
|
|
7
7
|
React.createElement(Grid, { item: true, xs: 6 },
|
|
8
8
|
React.createElement(Button, { fullWidth: true, onClick: function () { setPageStatus(2.3); } },
|
|
9
9
|
React.createElement(Stack, { width: 1, spacing: 1, px: 2, py: 2, bgcolor: theme.palette.grey[100], borderRadius: 6, alignItems: 'center' },
|
|
10
|
-
React.createElement("img", { width: 28, height: 28, src: "/sumsub.svg", alt: "scan" }),
|
|
10
|
+
React.createElement("img", { width: 28, height: 28, src: "https://idv.berify.me/sumsub.svg", alt: "scan" }),
|
|
11
11
|
React.createElement(Typography, { variant: 'h5', fontWeight: 700, color: 'black' }, "Sumsub"),
|
|
12
12
|
React.createElement(Typography, { variant: 'body2', color: theme.palette.info.light, fontStyle: 'italic' }, "avg. 30s completion"))))));
|
|
13
13
|
};
|
|
@@ -7,7 +7,7 @@ var VeriffGrid = function (_a) {
|
|
|
7
7
|
React.createElement(Grid, { item: true, xs: 6 },
|
|
8
8
|
React.createElement(Button, { fullWidth: true, onClick: function () { setPageStatus(2.4); } },
|
|
9
9
|
React.createElement(Stack, { width: 1, spacing: 1, px: 2, py: 2, bgcolor: theme.palette.grey[100], borderRadius: 6, alignItems: 'center' },
|
|
10
|
-
React.createElement("img", { width: 28, height: 28, src: "/veriff.svg", alt: "scan" }),
|
|
10
|
+
React.createElement("img", { width: 28, height: 28, src: "https://idv.berify.me/veriff.svg", alt: "scan" }),
|
|
11
11
|
React.createElement(Typography, { variant: 'h5', fontWeight: 700, color: 'black' }, "Veriff"),
|
|
12
12
|
React.createElement(Typography, { variant: 'body2', color: theme.palette.info.light, fontStyle: 'italic' }, "avg. 30s completion"))))));
|
|
13
13
|
};
|
|
@@ -7,7 +7,7 @@ var YotiGrid = function (_a) {
|
|
|
7
7
|
React.createElement(Grid, { item: true, xs: 6 },
|
|
8
8
|
React.createElement(Button, { fullWidth: true, onClick: function () { setPageStatus(2.5); } },
|
|
9
9
|
React.createElement(Stack, { width: 1, spacing: 1, px: 2, py: 2, bgcolor: theme.palette.grey[100], borderRadius: 6, alignItems: 'center' },
|
|
10
|
-
React.createElement("img", { width: 28, height: 28, src: "/yoti.svg", alt: "scan" }),
|
|
10
|
+
React.createElement("img", { width: 28, height: 28, src: "https://idv.berify.me/yoti.svg", alt: "scan" }),
|
|
11
11
|
React.createElement(Typography, { variant: 'h5', fontWeight: 700, color: 'black' }, "Yoti"),
|
|
12
12
|
React.createElement(Typography, { variant: 'body2', color: theme.palette.info.light, fontStyle: 'italic' }, "avg. 30s completion"))))));
|
|
13
13
|
};
|
|
@@ -86,7 +86,7 @@ var OnBoarding = function (_a) {
|
|
|
86
86
|
_a.sent();
|
|
87
87
|
return [3 /*break*/, 7];
|
|
88
88
|
case 5:
|
|
89
|
-
onError('
|
|
89
|
+
onError('Something went wrong, but we’re working on it. Please try again later or contact support for assistance.');
|
|
90
90
|
return [2 /*return*/];
|
|
91
91
|
case 6:
|
|
92
92
|
if (approveResponse.yotiId)
|
|
@@ -108,7 +108,7 @@ var OnBoarding = function (_a) {
|
|
|
108
108
|
firstDetail: 'getUserByYotiId',
|
|
109
109
|
secondDetail: JSON.stringify(userResponse),
|
|
110
110
|
});
|
|
111
|
-
onError('
|
|
111
|
+
onError('Something went wrong, but we’re working on it. Please try again later or contact support for assistance.');
|
|
112
112
|
return [2 /*return*/];
|
|
113
113
|
}
|
|
114
114
|
// cuz secondDetail is too long
|
|
@@ -126,7 +126,7 @@ var OnBoarding = function (_a) {
|
|
|
126
126
|
return [3 /*break*/, 12];
|
|
127
127
|
case 10:
|
|
128
128
|
error_1 = _a.sent();
|
|
129
|
-
onError('
|
|
129
|
+
onError('Something went wrong, but we’re working on it. Please try again later or contact support for assistance.');
|
|
130
130
|
return [3 /*break*/, 12];
|
|
131
131
|
case 11:
|
|
132
132
|
setLoading(undefined);
|
|
@@ -150,7 +150,7 @@ var OnBoarding = function (_a) {
|
|
|
150
150
|
onGoBack();
|
|
151
151
|
break;
|
|
152
152
|
default:
|
|
153
|
-
onError('
|
|
153
|
+
onError('Something went wrong, but we’re working on it. Please try again later or contact support for assistance.');
|
|
154
154
|
break;
|
|
155
155
|
}
|
|
156
156
|
}, [onError, onGoBack, token, user]);
|
|
@@ -178,14 +178,14 @@ var OnBoarding = function (_a) {
|
|
|
178
178
|
secondDetail: JSON.stringify(response),
|
|
179
179
|
});
|
|
180
180
|
if ('error' in response) {
|
|
181
|
-
onError('
|
|
181
|
+
onError('Something went wrong, but we’re working on it. Please try again later or contact support for assistance.');
|
|
182
182
|
return [2 /*return*/];
|
|
183
183
|
}
|
|
184
184
|
setSession(response);
|
|
185
185
|
return [3 /*break*/, 5];
|
|
186
186
|
case 3:
|
|
187
187
|
error_2 = _a.sent();
|
|
188
|
-
onError('
|
|
188
|
+
onError('Something went wrong, but we’re working on it. Please try again later or contact support for assistance.');
|
|
189
189
|
return [3 /*break*/, 5];
|
|
190
190
|
case 4:
|
|
191
191
|
setLoading(undefined);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useState } from 'react';
|
|
2
|
-
import TryAgain from '../../TryAgain';
|
|
3
2
|
import OnBoarding from './OnBoarding';
|
|
3
|
+
import SomethingWrong from '../../SomethingWrong';
|
|
4
4
|
var YotiOnBoarding = function (_a) {
|
|
5
5
|
var user = _a.user, setUser = _a.setUser, onSuccess = _a.onSuccess, onGoBack = _a.onGoBack, token = _a.token;
|
|
6
6
|
var _b = useState(), error = _b[0], setError = _b[1];
|
|
@@ -8,7 +8,7 @@ var YotiOnBoarding = function (_a) {
|
|
|
8
8
|
setError(error);
|
|
9
9
|
}, []);
|
|
10
10
|
if (error || !token)
|
|
11
|
-
return (React.createElement(
|
|
11
|
+
return (React.createElement(SomethingWrong, { message: error }));
|
|
12
12
|
return (React.createElement(OnBoarding, { user: user, setUser: setUser, onSuccess: onSuccess, onError: handleError, onGoBack: onGoBack, token: token }));
|
|
13
13
|
};
|
|
14
14
|
export default YotiOnBoarding;
|
|
@@ -6,7 +6,7 @@ var QrcodeExpired = function () {
|
|
|
6
6
|
return (React.createElement(React.Fragment, null,
|
|
7
7
|
React.createElement(Stack, { height: 1, spacing: 4, justifyContent: 'space-between', py: 4, overflow: 'auto' },
|
|
8
8
|
React.createElement(Stack, { spacing: 2, textAlign: 'center', alignItems: 'center' },
|
|
9
|
-
React.createElement("img", { width: 60, height: 60, src: "https://
|
|
9
|
+
React.createElement("img", { width: 60, height: 60, src: "https://idv.berify.me/errorIcon.png", alt: "berify" }),
|
|
10
10
|
React.createElement(Typography, { variant: "h2", fontWeight: 700 }, "QR Code Expired"),
|
|
11
11
|
React.createElement(Typography, { variant: "body1", color: theme.palette.text.secondary }, "The QR code is only active for 5 minutes."),
|
|
12
12
|
React.createElement(Typography, { variant: "body1", color: theme.palette.text.secondary }, "Return to the original sign up window to request for a new QR code.")),
|
|
@@ -42,6 +42,7 @@ import { useState } from 'react';
|
|
|
42
42
|
import PhoneInput from 'react-phone-input-2';
|
|
43
43
|
import './style.css';
|
|
44
44
|
import berifymeApi, { ActionType } from '../../api/api';
|
|
45
|
+
import { PageStatus } from '../../enum';
|
|
45
46
|
import theme from "../theme";
|
|
46
47
|
import { createAuthenticationLog } from '../AuthenticationLogs';
|
|
47
48
|
import { createDeveloperLog } from '../createDeveloperLog';
|
|
@@ -93,7 +94,7 @@ var SendSns = function (_a) {
|
|
|
93
94
|
case 1:
|
|
94
95
|
getVender = _f.sent();
|
|
95
96
|
if (getVender.error) {
|
|
96
|
-
setError((_a = getVender.error) !== null && _a !== void 0 ? _a : '
|
|
97
|
+
setError((_a = getVender.error) !== null && _a !== void 0 ? _a : 'Something went wrong, but we’re working on it. Please try again later or contact support for assistance.');
|
|
97
98
|
setIsLoading(false);
|
|
98
99
|
createDeveloperLog({
|
|
99
100
|
source: 'FRONTEND',
|
|
@@ -161,7 +162,7 @@ var SendSns = function (_a) {
|
|
|
161
162
|
});
|
|
162
163
|
setUser(deviceUser.user);
|
|
163
164
|
setModalHeight('60vh');
|
|
164
|
-
setPageStatus(
|
|
165
|
+
setPageStatus(PageStatus.AllSet);
|
|
165
166
|
setIsLoading(false);
|
|
166
167
|
createDeveloperLog({
|
|
167
168
|
userId: webauthnLogin.user.id,
|
|
@@ -202,30 +203,33 @@ var SendSns = function (_a) {
|
|
|
202
203
|
// }
|
|
203
204
|
// }
|
|
204
205
|
if (getVender.vender === 'authid') {
|
|
205
|
-
setLogin(
|
|
206
|
+
setLogin(PageStatus.AuthidLogin);
|
|
206
207
|
setModalHeight('50vh');
|
|
207
208
|
setFullName(getVender.fullName);
|
|
208
209
|
}
|
|
209
210
|
else if (getVender.vender === 'clear') {
|
|
210
|
-
setLogin(
|
|
211
|
+
setLogin(PageStatus.ClearLogin);
|
|
211
212
|
setModalHeight('50vh');
|
|
212
213
|
setFullName(getVender.fullName);
|
|
213
214
|
}
|
|
214
215
|
else if (getVender.vender === 'incode') {
|
|
215
|
-
setLogin(
|
|
216
|
-
setModalHeight('50vh');
|
|
217
|
-
setFullName(getVender.fullName);
|
|
218
|
-
}
|
|
219
|
-
else if (getVender.vender === 'sumsub') {
|
|
220
|
-
setLogin(8);
|
|
221
|
-
setModalHeight('50vh');
|
|
222
|
-
setFullName(getVender.fullName);
|
|
223
|
-
}
|
|
224
|
-
else if (getVender.vender === 'veriff') {
|
|
225
|
-
setLogin(9);
|
|
216
|
+
setLogin(PageStatus.IncodeLogin);
|
|
226
217
|
setModalHeight('50vh');
|
|
227
218
|
setFullName(getVender.fullName);
|
|
228
219
|
}
|
|
220
|
+
// else if (getVender.vender === 'sumsub') {
|
|
221
|
+
// setLogin(PageStatus.SumsubLogin);
|
|
222
|
+
// setModalHeight('50vh');
|
|
223
|
+
// setFullName(getVender.fullName);
|
|
224
|
+
// } else if (getVender.vender === 'veriff') {
|
|
225
|
+
// setLogin(PageStatus.VeriffLogin);
|
|
226
|
+
// setModalHeight('50vh');
|
|
227
|
+
// setFullName(getVender.fullName);
|
|
228
|
+
// } else if (getVender.vender === 'yoti') {
|
|
229
|
+
// setLogin(PageStatus.YotiLogin);
|
|
230
|
+
// setModalHeight('50vh');
|
|
231
|
+
// setFullName(getVender.fullName);
|
|
232
|
+
// }
|
|
229
233
|
else {
|
|
230
234
|
setPageStatus(1.1);
|
|
231
235
|
// const res = await berifymeApi.auth.sendPhoneNumberCode({phoneNumber: processedInputValue, token});
|
|
@@ -312,10 +316,9 @@ var SendSns = function (_a) {
|
|
|
312
316
|
React.createElement(Stack, { height: 1, spacing: 4, justifyContent: 'space-between', py: 8 },
|
|
313
317
|
React.createElement(Stack, { spacing: 2, textAlign: 'center', alignItems: 'center' },
|
|
314
318
|
React.createElement(Typography, { variant: "h1" }, "\uD83D\uDC4B"),
|
|
315
|
-
React.createElement(
|
|
316
|
-
"Welcome back,",
|
|
317
|
-
React.createElement("
|
|
318
|
-
React.createElement(Typography, { variant: "h2", fontWeight: 700 }, fullName),
|
|
319
|
+
React.createElement(Stack, null,
|
|
320
|
+
React.createElement(Typography, { variant: "h2", fontWeight: 700 }, "Welcome back,"),
|
|
321
|
+
React.createElement(Typography, { variant: "h2", fontWeight: 700 }, fullName)),
|
|
319
322
|
React.createElement(Typography, { variant: "body1", color: theme.palette.text.secondary }, "Take a selfie to verify your identity.")),
|
|
320
323
|
React.createElement(Stack, { alignItems: 'center' },
|
|
321
324
|
React.createElement(Button, { variant: "contained", onClick: function () { setPageStatus(login); }, sx: { minWidth: 160 } }, "Take my selfie")),
|
|
@@ -6,7 +6,7 @@ var SessionInterrupted = function () {
|
|
|
6
6
|
return (React.createElement(React.Fragment, null,
|
|
7
7
|
React.createElement(Stack, { height: 1, spacing: 4, justifyContent: 'space-between', py: 4, overflow: 'auto' },
|
|
8
8
|
React.createElement(Stack, { spacing: 2, textAlign: 'center', alignItems: 'center' },
|
|
9
|
-
React.createElement("img", { width: 60, height: 60, src: "https://
|
|
9
|
+
React.createElement("img", { width: 60, height: 60, src: "https://idv.berify.me/warningIcon.png", alt: "berify" }),
|
|
10
10
|
React.createElement(Typography, { variant: "h2", fontWeight: 700 }, "Session Interrupted"),
|
|
11
11
|
React.createElement(Typography, { variant: "body1", color: theme.palette.text.secondary }, "The sign-up window on your desktop browser was closed."),
|
|
12
12
|
React.createElement(Typography, { variant: "body1", color: theme.palette.text.secondary }, "Please restart the process on your desktop browser to try again.")),
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, Stack, Typography, IconButton } from '@mui/material';
|
|
3
|
+
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
|
|
4
|
+
import Footer from './Footer';
|
|
5
|
+
import { useEffect, useState } from 'react';
|
|
6
|
+
var SomethingWrong = function (_a) {
|
|
7
|
+
var message = _a.message, pressButton = _a.pressButton, venderErrorHandleBack = _a.venderErrorHandleBack;
|
|
8
|
+
var _b = useState(false), isVenderError = _b[0], setIsVenderError = _b[1];
|
|
9
|
+
var handleContinue = function () {
|
|
10
|
+
if (pressButton)
|
|
11
|
+
pressButton();
|
|
12
|
+
else
|
|
13
|
+
window.location.reload();
|
|
14
|
+
};
|
|
15
|
+
useEffect(function () {
|
|
16
|
+
if (message === 'Try again later or choose a different verification provider to proceed.') {
|
|
17
|
+
setIsVenderError(true);
|
|
18
|
+
}
|
|
19
|
+
}, [message]);
|
|
20
|
+
return (React.createElement(Stack, { height: 1, width: 1 },
|
|
21
|
+
isVenderError && (React.createElement(Stack, { width: 1, alignItems: "flex-start", pl: 2, pt: 2 },
|
|
22
|
+
React.createElement(IconButton, { onClick: venderErrorHandleBack },
|
|
23
|
+
React.createElement(ArrowBackIcon, { fontSize: 'large', color: 'primary' })))),
|
|
24
|
+
React.createElement(Stack, { pt: isVenderError ? 0 : 2, height: 1, width: 1, justifyContent: 'space-between', alignItems: 'center' },
|
|
25
|
+
React.createElement(Stack, { spacing: 4 },
|
|
26
|
+
React.createElement(Typography, { variant: "h1", fontWeight: 700, textAlign: "center", sx: { fontSize: { xs: '3.8rem', sm: '4rem' }, lineHeight: 1.2 } }, ':-('),
|
|
27
|
+
React.createElement(Typography, { variant: "h2", fontWeight: 700, textAlign: "center" }, "Oops!"),
|
|
28
|
+
isVenderError &&
|
|
29
|
+
React.createElement(Typography, { variant: "body1", color: "text.secondary", textAlign: "center" }, "Something went wrong."),
|
|
30
|
+
message !== undefined && React.createElement(Typography, { variant: "body1", color: "text.secondary", textAlign: "center" }, message ? message : 'Something went wrong, but we’re working on it. Please try again later or contact support for assistance.')),
|
|
31
|
+
React.createElement(Stack, { spacing: 2, pb: 0, alignItems: 'center' },
|
|
32
|
+
React.createElement(Button, { variant: "contained", color: "primary", onClick: isVenderError ? venderErrorHandleBack : handleContinue, sx: {
|
|
33
|
+
bgcolor: 'black',
|
|
34
|
+
color: 'white',
|
|
35
|
+
borderRadius: '25px',
|
|
36
|
+
py: 1.5,
|
|
37
|
+
width: '120px'
|
|
38
|
+
} }, isVenderError ? 'Go back' : 'Try again'),
|
|
39
|
+
React.createElement(Footer, null)))));
|
|
40
|
+
};
|
|
41
|
+
export default SomethingWrong;
|