@bytexbyte/berifyme-react-sdk 1.0.3 → 1.0.4
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 +69 -52
- package/dist/api/api.js +24 -0
- package/dist/components/AllSet/index.js +22 -24
- package/dist/components/Login/clearAllSet.js +2 -2
- package/dist/components/OnBoarding/clear/clearAllSet.js +2 -2
- package/dist/components/QrcodeExpired.js +17 -0
- package/dist/components/SessionInterrupted.js +17 -0
- package/dist/enum/index.js +2 -0
- package/dist/types/BerifymeModal/index.d.ts +1 -1
- package/dist/types/api/api.d.ts +7 -0
- package/dist/types/components/AllSet/index.d.ts +2 -1
- 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/QrcodeExpired.d.ts +3 -0
- package/dist/types/components/SessionInterrupted.d.ts +3 -0
- package/dist/types/enum/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -34,38 +34,35 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
34
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
import { environmentDomains } from '../lib/environmentDomains';
|
|
38
|
-
import { PageStatus } from '../enum';
|
|
39
37
|
import { Box, CircularProgress, CssBaseline, ThemeProvider } from '@mui/material';
|
|
40
38
|
import React, { useEffect, useState } from 'react';
|
|
41
|
-
import
|
|
39
|
+
import '../../index.css';
|
|
42
40
|
import berifymeApi, { initializeBerifymeApi } from '../api/api';
|
|
43
|
-
import { incode } from '../vender/incode/incode';
|
|
44
41
|
import AllSet from '../components/AllSet';
|
|
45
|
-
import Modal from './MainModal';
|
|
46
|
-
import RedirectToMobile from '../components/RedirectToMobile';
|
|
47
|
-
import ScreenRotation from '../components/ScreenRotation';
|
|
48
|
-
import TryAgainInModal from '../components/TryAgainInModal';
|
|
49
42
|
import { createDeveloperLog } from '../components/createDeveloperLog';
|
|
50
43
|
import { AuthidLogin } from '../components/Login/authid';
|
|
51
44
|
import { ClearLogin } from '../components/Login/clear';
|
|
52
45
|
import { ClearLoginAllSet } from '../components/Login/clearAllSet';
|
|
53
46
|
import { IncodeLogin } from '../components/Login/incode';
|
|
54
|
-
//[Wings] import SumsubLogin from './login/sumsub';
|
|
55
|
-
//[Wings] import VeriffLogin from './login/veriff';
|
|
56
47
|
import AuthID from '../components/OnBoarding/authId';
|
|
57
48
|
import IdOrPassport from '../components/OnBoarding/authId/idOrPassport';
|
|
58
49
|
import { ClearOnboarding } from '../components/OnBoarding/clear';
|
|
59
50
|
import { ClearOnboardingAllSet } from '../components/OnBoarding/clear/clearAllSet';
|
|
60
51
|
import { IncodeOnBoarding } from '../components/OnBoarding/incode';
|
|
61
|
-
//[Wings] import SumsubOnBoarding from './onBoarding/sumsub';
|
|
62
52
|
import Vender from '../components/OnBoarding/vender';
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
import RedirectToMobile from '../components/RedirectToMobile';
|
|
54
|
+
import ScreenRotation from '../components/ScreenRotation';
|
|
65
55
|
import SendSns from '../components/SendSns';
|
|
56
|
+
import theme from '../components/theme';
|
|
57
|
+
import TryAgainInModal from '../components/TryAgainInModal';
|
|
66
58
|
import VerifyNewUser from '../components/VerifyWithPhoneNumber/NewUser';
|
|
67
59
|
import VerifyUser from '../components/VerifyWithPhoneNumber/User';
|
|
68
|
-
import '
|
|
60
|
+
import { PageStatus } from '../enum';
|
|
61
|
+
import { environmentDomains } from '../lib/environmentDomains';
|
|
62
|
+
import { incode } from '../vender/incode/incode';
|
|
63
|
+
import Modal from './MainModal';
|
|
64
|
+
import QrcodeExpired from '../components/QrcodeExpired';
|
|
65
|
+
import SessionInterrupted from '../components/SessionInterrupted';
|
|
69
66
|
var HomeModal = function (_a) {
|
|
70
67
|
var apiKeyId = _a.apiKeyId, secretKey = _a.secretKey, redirectUrl = _a.redirectUrl, _b = _a.initialPhoneNumber, initialPhoneNumber = _b === void 0 ? '' : _b, environment = _a.environment, forceQrcode = _a.forceQrcode;
|
|
71
68
|
var _c = useState(window.innerWidth > window.innerHeight), isLandscape = _c[0], setIsLandscape = _c[1];
|
|
@@ -156,6 +153,25 @@ var HomeModal = function (_a) {
|
|
|
156
153
|
});
|
|
157
154
|
});
|
|
158
155
|
}
|
|
156
|
+
function checkDesktopRedirectUrlIdExpired(_a) {
|
|
157
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
158
|
+
var res;
|
|
159
|
+
var token = _b.token, desktopRedirectUrlId = _b.desktopRedirectUrlId;
|
|
160
|
+
return __generator(this, function (_c) {
|
|
161
|
+
switch (_c.label) {
|
|
162
|
+
case 0: return [4 /*yield*/, berifymeApi.thirdParty.checkDesktopRedirectUrlIdExpired({ token: token, desktopRedirectUrlId: desktopRedirectUrlId })];
|
|
163
|
+
case 1:
|
|
164
|
+
res = _c.sent();
|
|
165
|
+
console.log('checkDesktopRedirectUrlIdExpired', res.error);
|
|
166
|
+
if (res.error)
|
|
167
|
+
setPageStatus(PageStatus.QRCodeExpired);
|
|
168
|
+
else
|
|
169
|
+
setPageStatus(PageStatus.SendSns);
|
|
170
|
+
return [2 /*return*/];
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
}
|
|
159
175
|
useEffect(function () {
|
|
160
176
|
if (incode.isDesktop() || forceQrcode) {
|
|
161
177
|
setUseQrcode(true);
|
|
@@ -181,18 +197,24 @@ var HomeModal = function (_a) {
|
|
|
181
197
|
// } else {
|
|
182
198
|
// setError('Token is required to access this page. Please include a valid token in the URL.');
|
|
183
199
|
// }
|
|
184
|
-
|
|
185
|
-
if (res.desktopRedirectUrlId)
|
|
200
|
+
// 若params有desktopRedirectUrlId, 就設定useState
|
|
201
|
+
if (res.desktopRedirectUrlId) {
|
|
186
202
|
setDesktopRedirectUrlId(res.desktopRedirectUrlId);
|
|
203
|
+
}
|
|
187
204
|
// 確定是否為clear callback onboarding or login,是就轉導致對應頁面
|
|
205
|
+
// 然後如果有desktopRedirectUrlId, 檢查有沒有過期, 有就去QrCodeExpired頁面, 沒有就去SendSns
|
|
206
|
+
// 如果沒有desktopRedirectUrlId就照流程去SendSns
|
|
188
207
|
if (res.callback === 'clear_login') {
|
|
189
208
|
setPageStatus(6);
|
|
190
209
|
}
|
|
191
210
|
else if (res.callback === 'clear_onboarding') {
|
|
192
211
|
setPageStatus(7);
|
|
193
212
|
}
|
|
213
|
+
else if (res.desktopRedirectUrlId) {
|
|
214
|
+
checkDesktopRedirectUrlIdExpired({ token: res.token, desktopRedirectUrlId: res.desktopRedirectUrlId });
|
|
215
|
+
}
|
|
194
216
|
else {
|
|
195
|
-
setPageStatus(
|
|
217
|
+
setPageStatus(PageStatus.SendSns);
|
|
196
218
|
}
|
|
197
219
|
}, []);
|
|
198
220
|
useEffect(function () {
|
|
@@ -221,60 +243,51 @@ var HomeModal = function (_a) {
|
|
|
221
243
|
else if (isLandscape) {
|
|
222
244
|
setModalHeight('100vh');
|
|
223
245
|
}
|
|
224
|
-
else if (pageStatus ===
|
|
246
|
+
else if (pageStatus === PageStatus.SendSns) {
|
|
225
247
|
setModalHeight('58vh');
|
|
226
248
|
}
|
|
227
|
-
else if (pageStatus ===
|
|
249
|
+
else if (pageStatus === PageStatus.QRCodeExpired) {
|
|
250
|
+
setModalHeight('46vh');
|
|
251
|
+
}
|
|
252
|
+
else if (pageStatus === PageStatus.VerifyNewUser) {
|
|
228
253
|
setModalHeight('64vh');
|
|
229
254
|
}
|
|
230
|
-
else if (pageStatus ===
|
|
255
|
+
else if (pageStatus === PageStatus.AuthIdOnboarding) {
|
|
231
256
|
setModalHeight('90vh');
|
|
232
257
|
}
|
|
233
|
-
else if (pageStatus ===
|
|
258
|
+
else if (pageStatus === PageStatus.ClearLogin) {
|
|
234
259
|
setModalHeight('100vh');
|
|
235
260
|
}
|
|
236
|
-
else if (pageStatus ===
|
|
261
|
+
else if (pageStatus === PageStatus.IncodeLogin) {
|
|
237
262
|
setModalHeight('100vh');
|
|
238
263
|
}
|
|
239
|
-
else if (pageStatus ===
|
|
264
|
+
else if (pageStatus === PageStatus.ClearLoginAllSet) {
|
|
240
265
|
setModalHeight('58vh');
|
|
241
266
|
}
|
|
242
|
-
else if (pageStatus ===
|
|
267
|
+
else if (pageStatus === PageStatus.ClearOnboardingAllSet) {
|
|
243
268
|
setModalHeight('58vh');
|
|
244
269
|
}
|
|
245
|
-
else if (pageStatus ===
|
|
246
|
-
setModalHeight('80vh');
|
|
247
|
-
}
|
|
248
|
-
else if (pageStatus === 9) {
|
|
249
|
-
setModalHeight('100vh');
|
|
250
|
-
}
|
|
251
|
-
else if (pageStatus === 1.1) {
|
|
270
|
+
else if (pageStatus === PageStatus.Vender) {
|
|
252
271
|
setModalHeight('80vh');
|
|
253
272
|
}
|
|
254
|
-
else if (pageStatus ===
|
|
273
|
+
else if (pageStatus === PageStatus.IdOrPassport) {
|
|
255
274
|
setModalHeight('55vh');
|
|
256
275
|
}
|
|
257
|
-
else if (pageStatus ===
|
|
276
|
+
else if (pageStatus === PageStatus.VerifyUser) {
|
|
258
277
|
setModalHeight('46vh');
|
|
259
278
|
}
|
|
260
|
-
else if (pageStatus ===
|
|
279
|
+
else if (pageStatus === PageStatus.ClearOnboarding) {
|
|
261
280
|
setModalHeight('100vh');
|
|
262
281
|
}
|
|
263
|
-
else if (pageStatus ===
|
|
282
|
+
else if (pageStatus === PageStatus.IncodeOnBoarding) {
|
|
264
283
|
setModalHeight('100vh');
|
|
265
284
|
}
|
|
266
|
-
else if (pageStatus ===
|
|
267
|
-
setModalHeight('80vh');
|
|
268
|
-
}
|
|
269
|
-
else if (pageStatus === 2.4) {
|
|
270
|
-
setModalHeight('100vh');
|
|
271
|
-
}
|
|
272
|
-
else if (pageStatus === 2.5) {
|
|
273
|
-
setModalHeight('80vh');
|
|
274
|
-
}
|
|
275
|
-
else if (pageStatus === 10) {
|
|
285
|
+
else if (pageStatus === PageStatus.AllSet) {
|
|
276
286
|
setModalHeight('58vh');
|
|
277
287
|
}
|
|
288
|
+
else if (pageStatus === PageStatus.SessionInterrupted) {
|
|
289
|
+
setModalHeight('46vh');
|
|
290
|
+
}
|
|
278
291
|
else {
|
|
279
292
|
setModalHeight('80vh');
|
|
280
293
|
}
|
|
@@ -307,6 +320,10 @@ var HomeModal = function (_a) {
|
|
|
307
320
|
background: '#FFFFFF'
|
|
308
321
|
} },
|
|
309
322
|
React.createElement(CircularProgress, null)),
|
|
323
|
+
pageStatus === PageStatus.SessionInterrupted &&
|
|
324
|
+
React.createElement(SessionInterrupted, null),
|
|
325
|
+
pageStatus === PageStatus.QRCodeExpired &&
|
|
326
|
+
React.createElement(QrcodeExpired, null),
|
|
310
327
|
pageStatus === PageStatus.SendSns &&
|
|
311
328
|
React.createElement(SendSns, { token: token, inputValue: inputValue, setInputValue: setInputValue, setError: setError, setPageStatus: setPageStatus, setProcessedPhoneNumber: setProcessedPhoneNumber, setModalHeight: setModalHeight, setUser: setUser, environment: environment }),
|
|
312
329
|
pageStatus === PageStatus.VerifyNewUser &&
|
|
@@ -318,22 +335,22 @@ var HomeModal = function (_a) {
|
|
|
318
335
|
pageStatus === PageStatus.VerifyUser &&
|
|
319
336
|
React.createElement(VerifyUser, { token: token, inputValue: inputValue, setError: setError, setPageStatus: setPageStatus, setModalHeight: setModalHeight, setUser: setUser, environment: environment }),
|
|
320
337
|
pageStatus === PageStatus.AuthIdOnboarding && user &&
|
|
321
|
-
React.createElement(AuthID, { token: token, goToAllSet: function () { return setPageStatus(
|
|
338
|
+
React.createElement(AuthID, { token: token, goToAllSet: function () { return setPageStatus(PageStatus.AllSet); }, setError: setError, userId: user.id, setUser: setUser, selectedIdType: authIdSelectedIdType }),
|
|
322
339
|
pageStatus === PageStatus.ClearOnboarding && user &&
|
|
323
340
|
React.createElement(ClearOnboarding, { token: token, user: user, desktopRedirectUrlId: desktopRedirectUrlId }),
|
|
324
341
|
pageStatus === PageStatus.IncodeOnBoarding && user &&
|
|
325
|
-
React.createElement(IncodeOnBoarding, { user: user, setUser: setUser, token: token, goToAllSet: function () { return setPageStatus(
|
|
342
|
+
React.createElement(IncodeOnBoarding, { user: user, setUser: setUser, token: token, goToAllSet: function () { return setPageStatus(PageStatus.AllSet); } }),
|
|
326
343
|
pageStatus === PageStatus.AuthidLogin && processedPhoneNumber &&
|
|
327
|
-
React.createElement(AuthidLogin, { token: token, goToAllSet: function () { return setPageStatus(
|
|
344
|
+
React.createElement(AuthidLogin, { token: token, goToAllSet: function () { return setPageStatus(PageStatus.AllSet); }, phoneNumber: processedPhoneNumber, setUser: setUser }),
|
|
328
345
|
pageStatus === PageStatus.ClearLogin &&
|
|
329
346
|
React.createElement(ClearLogin, { token: token, userId: user === null || user === void 0 ? void 0 : user.id, desktopRedirectUrlId: desktopRedirectUrlId }),
|
|
330
347
|
pageStatus === PageStatus.IncodeLogin &&
|
|
331
|
-
React.createElement(IncodeLogin, { token: token, user: user, setUser: setUser, goToAllSet: function () { return setPageStatus(
|
|
348
|
+
React.createElement(IncodeLogin, { token: token, user: user, setUser: setUser, goToAllSet: function () { return setPageStatus(PageStatus.AllSet); } }),
|
|
332
349
|
pageStatus === PageStatus.ClearLoginAllSet &&
|
|
333
|
-
React.createElement(ClearLoginAllSet, { token: token, desktopRedirectUrlId: desktopRedirectUrlId }),
|
|
350
|
+
React.createElement(ClearLoginAllSet, { token: token, desktopRedirectUrlId: desktopRedirectUrlId, setPageStatus: setPageStatus }),
|
|
334
351
|
pageStatus === PageStatus.ClearOnboardingAllSet &&
|
|
335
|
-
React.createElement(ClearOnboardingAllSet, { token: token, desktopRedirectUrlId: desktopRedirectUrlId }),
|
|
352
|
+
React.createElement(ClearOnboardingAllSet, { token: token, desktopRedirectUrlId: desktopRedirectUrlId, setPageStatus: setPageStatus }),
|
|
336
353
|
pageStatus === PageStatus.AllSet &&
|
|
337
|
-
React.createElement(AllSet, { user: user, token: token, desktopRedirectUrlId: desktopRedirectUrlId })))))))));
|
|
354
|
+
React.createElement(AllSet, { user: user, token: token, desktopRedirectUrlId: desktopRedirectUrlId, setPageStatus: setPageStatus })))))))));
|
|
338
355
|
};
|
|
339
356
|
export default HomeModal;
|
package/dist/api/api.js
CHANGED
|
@@ -558,6 +558,29 @@ function checkThirdPartyVerificationToken(token) {
|
|
|
558
558
|
});
|
|
559
559
|
});
|
|
560
560
|
}
|
|
561
|
+
function checkDesktopRedirectUrlIdExpired(_a) {
|
|
562
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
563
|
+
var url, res;
|
|
564
|
+
var token = _b.token, desktopRedirectUrlId = _b.desktopRedirectUrlId;
|
|
565
|
+
return __generator(this, function (_c) {
|
|
566
|
+
switch (_c.label) {
|
|
567
|
+
case 0:
|
|
568
|
+
url = "".concat(config.backendDomain, "/api/thirdParty/checkDesktopRedirectUrlIdExpired?desktopRedirectUrlId=").concat(desktopRedirectUrlId);
|
|
569
|
+
console.log('UrlString: ', url);
|
|
570
|
+
return [4 /*yield*/, axios.get(url, {
|
|
571
|
+
headers: {
|
|
572
|
+
'Content-Type': 'application/json',
|
|
573
|
+
'token': token,
|
|
574
|
+
}
|
|
575
|
+
})];
|
|
576
|
+
case 1:
|
|
577
|
+
res = _c.sent();
|
|
578
|
+
console.log('UrlRes data: ', res.data);
|
|
579
|
+
return [2 /*return*/, res.data];
|
|
580
|
+
}
|
|
581
|
+
});
|
|
582
|
+
});
|
|
583
|
+
}
|
|
561
584
|
function sendVerifyEmail(email) {
|
|
562
585
|
return __awaiter(this, void 0, void 0, function () {
|
|
563
586
|
var url, res;
|
|
@@ -1292,6 +1315,7 @@ var berifymeApi = {
|
|
|
1292
1315
|
thirdParty: {
|
|
1293
1316
|
getRedirectUrl: getRedirectUrl,
|
|
1294
1317
|
checkThirdPartyVerificationToken: checkThirdPartyVerificationToken,
|
|
1318
|
+
checkDesktopRedirectUrlIdExpired: checkDesktopRedirectUrlIdExpired,
|
|
1295
1319
|
},
|
|
1296
1320
|
scheduld: {
|
|
1297
1321
|
initUpdateAdminTokenSchedule: initUpdateAdminTokenSchedule,
|
|
@@ -44,6 +44,7 @@ import { useEffect, useState } from "react";
|
|
|
44
44
|
import TryAgain from "../TryAgain";
|
|
45
45
|
import { v4 as uuidv4 } from 'uuid';
|
|
46
46
|
import { createDeveloperLog } from "../createDeveloperLog";
|
|
47
|
+
import { PageStatus } from "../../enum";
|
|
47
48
|
var createDeviceId = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
48
49
|
var newDeviceId;
|
|
49
50
|
var userId = _b.userId;
|
|
@@ -62,7 +63,7 @@ var createDeviceId = function (_a) { return __awaiter(void 0, [_a], void 0, func
|
|
|
62
63
|
});
|
|
63
64
|
}); };
|
|
64
65
|
var AllSet = function (_a) {
|
|
65
|
-
var user = _a.user, token = _a.token, desktopRedirectUrlId = _a.desktopRedirectUrlId;
|
|
66
|
+
var user = _a.user, token = _a.token, desktopRedirectUrlId = _a.desktopRedirectUrlId, setPageStatus = _a.setPageStatus;
|
|
66
67
|
var _b = useState(''), error = _b[0], setError = _b[1];
|
|
67
68
|
var _c = useState(), desktopStatusMessage = _c[0], setDesktopStatusMessage = _c[1];
|
|
68
69
|
var _d = useState(true), loading = _d[0], setLoading = _d[1];
|
|
@@ -137,11 +138,11 @@ var AllSet = function (_a) {
|
|
|
137
138
|
if (desktopRedirectUrlId === undefined) {
|
|
138
139
|
setRedirectUrl(res.redirectUrl);
|
|
139
140
|
}
|
|
141
|
+
else if (res.heartbeatStopped) {
|
|
142
|
+
setPageStatus(PageStatus.SessionInterrupted);
|
|
143
|
+
}
|
|
140
144
|
else {
|
|
141
|
-
|
|
142
|
-
setDesktopStatusMessage('Session interrupted. Please retry.');
|
|
143
|
-
else
|
|
144
|
-
setDesktopStatusMessage('ID verification successful. Continue on your PC.');
|
|
145
|
+
setDesktopStatusMessage('Return to the original window to be redirected to the next page');
|
|
145
146
|
}
|
|
146
147
|
return [2 /*return*/];
|
|
147
148
|
}
|
|
@@ -161,24 +162,21 @@ var AllSet = function (_a) {
|
|
|
161
162
|
background: '#FFFFFF'
|
|
162
163
|
} },
|
|
163
164
|
React.createElement(CircularProgress, null)) :
|
|
164
|
-
React.createElement(
|
|
165
|
-
React.createElement(Stack, {
|
|
166
|
-
React.createElement(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
React.createElement(Stack, { direction: 'row', spacing: 2, textAlign: 'center', justifyContent: 'center', color: theme.palette.text.secondary },
|
|
181
|
-
React.createElement(GppGoodOutlinedIcon, null),
|
|
182
|
-
React.createElement(Typography, { variant: "body1" }, "Securely powered by Berify.me")))))));
|
|
165
|
+
React.createElement(Stack, { height: 1, spacing: 4, justifyContent: 'space-between', py: 4, overflow: 'auto' },
|
|
166
|
+
React.createElement(Stack, { spacing: 2, textAlign: 'center', alignItems: 'center' },
|
|
167
|
+
React.createElement("img", { width: 40, height: 40, src: "https://staging.berify.me/berify.svg", alt: "berify" }),
|
|
168
|
+
React.createElement(Typography, { variant: "h2", fontWeight: 700 },
|
|
169
|
+
"You\u2019re Berified,",
|
|
170
|
+
React.createElement("br", null), user === null || user === void 0 ? void 0 :
|
|
171
|
+
user.fullName),
|
|
172
|
+
React.createElement(Typography, { variant: "body1", color: theme.palette.text.secondary }, "Thank you for securely verifying your identity through Berify.me \uD83C\uDF89")),
|
|
173
|
+
desktopStatusMessage ?
|
|
174
|
+
React.createElement(Stack, { py: 4, textAlign: 'center', alignItems: 'center' },
|
|
175
|
+
React.createElement(Typography, { variant: "body1", color: theme.palette.text.secondary }, desktopStatusMessage)) :
|
|
176
|
+
React.createElement(Stack, { spacing: 2, alignItems: 'center' },
|
|
177
|
+
React.createElement(Button, { variant: "contained", onClick: function () { window.location.href = redirectUrl; }, sx: { minWidth: 160 } }, "Continue")),
|
|
178
|
+
React.createElement(Stack, { direction: 'row', spacing: 2, textAlign: 'center', justifyContent: 'center', color: theme.palette.text.secondary },
|
|
179
|
+
React.createElement(GppGoodOutlinedIcon, null),
|
|
180
|
+
React.createElement(Typography, { variant: "body1" }, "Securely powered by Berify.me"))))));
|
|
183
181
|
};
|
|
184
182
|
export default AllSet;
|
|
@@ -43,7 +43,7 @@ import TryAgain from "../TryAgain";
|
|
|
43
43
|
import { updateAuthenticationLog } from "../AuthenticationLogs";
|
|
44
44
|
import { createDeveloperLog } from "../createDeveloperLog";
|
|
45
45
|
var ClearLoginAllSet = function (_a) {
|
|
46
|
-
var token = _a.token, desktopRedirectUrlId = _a.desktopRedirectUrlId;
|
|
46
|
+
var token = _a.token, desktopRedirectUrlId = _a.desktopRedirectUrlId, setPageStatus = _a.setPageStatus;
|
|
47
47
|
var _b = useState(), user = _b[0], setUser = _b[1]; // berifyme user
|
|
48
48
|
var _c = useState(), error = _c[0], setError = _c[1];
|
|
49
49
|
var getUserBySessionId = function (sessionId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -83,7 +83,7 @@ var ClearLoginAllSet = function (_a) {
|
|
|
83
83
|
}, []);
|
|
84
84
|
if (error)
|
|
85
85
|
return (React.createElement(TryAgain, { message: error }));
|
|
86
|
-
return (React.createElement(React.Fragment, null, user ? React.createElement(AllSet, { user: user, token: token, desktopRedirectUrlId: desktopRedirectUrlId }) :
|
|
86
|
+
return (React.createElement(React.Fragment, null, user ? React.createElement(AllSet, { user: user, token: token, desktopRedirectUrlId: desktopRedirectUrlId, setPageStatus: setPageStatus }) :
|
|
87
87
|
React.createElement(Box, { sx: {
|
|
88
88
|
display: 'flex',
|
|
89
89
|
justifyContent: 'center',
|
|
@@ -43,7 +43,7 @@ import TryAgain from "../../TryAgain";
|
|
|
43
43
|
import { updateAuthenticationLog } from "../../AuthenticationLogs";
|
|
44
44
|
import { createDeveloperLog } from "../../createDeveloperLog";
|
|
45
45
|
var ClearOnboardingAllSet = function (_a) {
|
|
46
|
-
var token = _a.token, desktopRedirectUrlId = _a.desktopRedirectUrlId;
|
|
46
|
+
var token = _a.token, desktopRedirectUrlId = _a.desktopRedirectUrlId, setPageStatus = _a.setPageStatus;
|
|
47
47
|
var _b = useState(), user = _b[0], setUser = _b[1]; // berifyme user
|
|
48
48
|
var _c = useState(), error = _c[0], setError = _c[1];
|
|
49
49
|
var approve = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
@@ -105,7 +105,7 @@ var ClearOnboardingAllSet = function (_a) {
|
|
|
105
105
|
}, []);
|
|
106
106
|
if (error)
|
|
107
107
|
return (React.createElement(TryAgain, { message: error }));
|
|
108
|
-
return (React.createElement(React.Fragment, null, user ? React.createElement(AllSet, { user: user, token: token, desktopRedirectUrlId: desktopRedirectUrlId }) :
|
|
108
|
+
return (React.createElement(React.Fragment, null, user ? React.createElement(AllSet, { user: user, token: token, desktopRedirectUrlId: desktopRedirectUrlId, setPageStatus: setPageStatus }) :
|
|
109
109
|
React.createElement(Box, { sx: {
|
|
110
110
|
display: 'flex',
|
|
111
111
|
justifyContent: 'center',
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Stack, Typography } from "@mui/material";
|
|
3
|
+
import theme from "../theme";
|
|
4
|
+
import GppGoodOutlinedIcon from '@mui/icons-material/GppGoodOutlined';
|
|
5
|
+
var QrcodeExpired = function () {
|
|
6
|
+
return (React.createElement(React.Fragment, null,
|
|
7
|
+
React.createElement(Stack, { height: 1, spacing: 4, justifyContent: 'space-between', py: 4, overflow: 'auto' },
|
|
8
|
+
React.createElement(Stack, { spacing: 2, textAlign: 'center', alignItems: 'center' },
|
|
9
|
+
React.createElement("img", { width: 60, height: 60, src: "https://staging.berify.me/errorIcon.png", alt: "berify" }),
|
|
10
|
+
React.createElement(Typography, { variant: "h2", fontWeight: 700 }, "QR Code Expired"),
|
|
11
|
+
React.createElement(Typography, { variant: "body1", color: theme.palette.text.secondary }, "The QR code is only active for 5 minutes."),
|
|
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.")),
|
|
13
|
+
React.createElement(Stack, { direction: 'row', spacing: 2, textAlign: 'center', justifyContent: 'center', color: theme.palette.text.secondary },
|
|
14
|
+
React.createElement(GppGoodOutlinedIcon, null),
|
|
15
|
+
React.createElement(Typography, { variant: "body1" }, "Securely powered by Berify.me")))));
|
|
16
|
+
};
|
|
17
|
+
export default QrcodeExpired;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Stack, Typography } from "@mui/material";
|
|
3
|
+
import theme from "../theme";
|
|
4
|
+
import GppGoodOutlinedIcon from '@mui/icons-material/GppGoodOutlined';
|
|
5
|
+
var SessionInterrupted = function () {
|
|
6
|
+
return (React.createElement(React.Fragment, null,
|
|
7
|
+
React.createElement(Stack, { height: 1, spacing: 4, justifyContent: 'space-between', py: 4, overflow: 'auto' },
|
|
8
|
+
React.createElement(Stack, { spacing: 2, textAlign: 'center', alignItems: 'center' },
|
|
9
|
+
React.createElement("img", { width: 60, height: 60, src: "https://staging.berify.me/warningIcon.png", alt: "berify" }),
|
|
10
|
+
React.createElement(Typography, { variant: "h2", fontWeight: 700 }, "Session Interrupted"),
|
|
11
|
+
React.createElement(Typography, { variant: "body1", color: theme.palette.text.secondary }, "The sign-up window on your desktop browser was closed."),
|
|
12
|
+
React.createElement(Typography, { variant: "body1", color: theme.palette.text.secondary }, "Please restart the process on your desktop browser to try again.")),
|
|
13
|
+
React.createElement(Stack, { direction: 'row', spacing: 2, textAlign: 'center', justifyContent: 'center', color: theme.palette.text.secondary },
|
|
14
|
+
React.createElement(GppGoodOutlinedIcon, null),
|
|
15
|
+
React.createElement(Typography, { variant: "body1" }, "Securely powered by Berify.me")))));
|
|
16
|
+
};
|
|
17
|
+
export default SessionInterrupted;
|
package/dist/enum/index.js
CHANGED
|
@@ -6,6 +6,8 @@ export var Environment;
|
|
|
6
6
|
})(Environment || (Environment = {}));
|
|
7
7
|
export var PageStatus;
|
|
8
8
|
(function (PageStatus) {
|
|
9
|
+
PageStatus[PageStatus["SessionInterrupted"] = -3] = "SessionInterrupted";
|
|
10
|
+
PageStatus[PageStatus["QRCodeExpired"] = -2] = "QRCodeExpired";
|
|
9
11
|
PageStatus[PageStatus["Loading"] = -1] = "Loading";
|
|
10
12
|
PageStatus[PageStatus["SendSns"] = 0] = "SendSns";
|
|
11
13
|
PageStatus[PageStatus["VerifyNewUser"] = 1] = "VerifyNewUser";
|
package/dist/types/api/api.d.ts
CHANGED
|
@@ -275,6 +275,12 @@ declare function checkThirdPartyVerificationToken(token: string): Promise<{
|
|
|
275
275
|
companyName?: string | null;
|
|
276
276
|
error?: string;
|
|
277
277
|
}>;
|
|
278
|
+
declare function checkDesktopRedirectUrlIdExpired({ token, desktopRedirectUrlId }: {
|
|
279
|
+
token: string;
|
|
280
|
+
desktopRedirectUrlId: string;
|
|
281
|
+
}): Promise<{
|
|
282
|
+
error?: string;
|
|
283
|
+
}>;
|
|
278
284
|
declare function sendVerifyEmail(email: string): Promise<{
|
|
279
285
|
success: boolean;
|
|
280
286
|
error?: string;
|
|
@@ -561,6 +567,7 @@ declare const berifymeApi: {
|
|
|
561
567
|
thirdParty: {
|
|
562
568
|
getRedirectUrl: typeof getRedirectUrl;
|
|
563
569
|
checkThirdPartyVerificationToken: typeof checkThirdPartyVerificationToken;
|
|
570
|
+
checkDesktopRedirectUrlIdExpired: typeof checkDesktopRedirectUrlIdExpired;
|
|
564
571
|
};
|
|
565
572
|
scheduld: {
|
|
566
573
|
initUpdateAdminTokenSchedule: typeof initUpdateAdminTokenSchedule;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { User } from "../../api/api";
|
|
3
|
-
declare const AllSet: ({ user, token, desktopRedirectUrlId }: {
|
|
3
|
+
declare const AllSet: ({ user, token, desktopRedirectUrlId, setPageStatus }: {
|
|
4
4
|
user: User | undefined;
|
|
5
5
|
token: string | undefined;
|
|
6
6
|
desktopRedirectUrlId?: string;
|
|
7
|
+
setPageStatus: React.Dispatch<React.SetStateAction<number>>;
|
|
7
8
|
}) => React.JSX.Element;
|
|
8
9
|
export default AllSet;
|