@tap-payments/auth-jsconnect 2.11.31-development → 2.12.0-development
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/build/api/lead.d.ts +2 -2
- package/build/assets/locales/ar.json +3 -3
- package/build/constants/app.js +60 -3
- package/build/constants/flows.d.ts +1 -0
- package/build/constants/flows.js +2 -1
- package/build/features/app/bank/bankStore.d.ts +7 -0
- package/build/features/app/bank/bankStore.js +84 -0
- package/build/features/app/board/boardStore.d.ts +5 -0
- package/build/features/app/board/boardStore.js +81 -0
- package/build/features/app/brand/brandStore.d.ts +7 -0
- package/build/features/app/brand/brandStore.js +83 -1
- package/build/features/app/business/businessStore.d.ts +10 -0
- package/build/features/app/business/businessStore.js +83 -1
- package/build/features/app/entity/entityStore.d.ts +7 -0
- package/build/features/app/entity/entityStore.js +85 -1
- package/build/features/app/individual/individualStore.d.ts +9 -0
- package/build/features/app/individual/individualStore.js +85 -1
- package/build/features/app/password/passwordStore.d.ts +9 -0
- package/build/features/app/password/passwordStore.js +82 -0
- package/build/features/app/tax/taxStore.d.ts +7 -0
- package/build/features/app/tax/taxStore.js +81 -0
- package/build/features/app/terminal/terminalStore.d.ts +9 -0
- package/build/features/app/terminal/terminalStore.js +76 -0
- package/build/features/auth/screens/OTPSessionExpired/OTPSessionExpired.js +2 -2
- package/build/features/bank/Bank.js +3 -2
- package/build/features/bank/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/bank/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/bank/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/bank/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/bank/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/bank/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/bank/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/bank/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/board/Board.js +5 -4
- package/build/features/board/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/board/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/board/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/board/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/board/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/board/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/board/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/board/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/brand/Brand.js +3 -2
- package/build/features/brand/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/brand/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/brand/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/brand/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/brand/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/brand/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/brand/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/brand/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/business/Business.js +3 -2
- package/build/features/business/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/business/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/business/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/business/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/business/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/business/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/business/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/business/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/connect/screens/OTPSessionExpired/OTPSessionExpired.js +2 -2
- package/build/features/connectExpress/screens/OTPSessionExpired/OTPSessionExpired.js +2 -2
- package/build/features/entity/Entity.js +3 -2
- package/build/features/entity/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/entity/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/entity/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/entity/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/entity/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/entity/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/entity/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/entity/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/featuresScreens.js +45 -0
- package/build/features/individual/Individual.js +3 -2
- package/build/features/individual/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/individual/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/individual/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/individual/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/individual/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/individual/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/individual/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/individual/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/password/Password.js +3 -2
- package/build/features/password/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/password/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/password/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/password/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/password/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/password/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/password/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/password/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/tax/Tax.js +3 -2
- package/build/features/tax/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/tax/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/tax/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/tax/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/tax/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/tax/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/tax/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/tax/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/terminal/Terminal.js +3 -2
- package/build/features/terminal/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/terminal/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/terminal/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/terminal/screens/OTPSessionExpired/OTPSessionExpired.js +89 -0
- package/build/features/terminal/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/terminal/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/terminal/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/terminal/screens/OTPSessionExpired/validation.js +4 -0
- package/package.json +1 -1
|
@@ -60,7 +60,7 @@ var _a;
|
|
|
60
60
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
61
61
|
import API, { setAuthSessionToGlobalHeaders } from '../../../api';
|
|
62
62
|
import { BusinessType, DocumentPurpose, FlowsTypes, LicenseType } from '../../../@types';
|
|
63
|
-
import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
63
|
+
import { handleCurrentActiveScreen, handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
64
64
|
import { ENTITY_STEP_NAMES } from '../../../constants';
|
|
65
65
|
import moment from 'moment';
|
|
66
66
|
import { convertNumbers2English, getRecentDocumentBasedOnPurpose, hasVerifiedValue, hasNoneEditableValue, sleep, formatNumberAsCurrency, removeAllCharsFromNumber, retrieveIndividualData, sendCustomEventToGTM, isAuthenticationVerificationFailed } from '../../../utils';
|
|
@@ -204,6 +204,58 @@ export var verifyEntityLeadOTP = createAsyncThunk('verifyEntityLeadOTP', functio
|
|
|
204
204
|
}
|
|
205
205
|
});
|
|
206
206
|
}); });
|
|
207
|
+
export var verifyLeadTokenSessionExpired = createAsyncThunk('entity/verifyLeadTokenSessionExpired', function (redirect, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
208
|
+
var entity, payload, data;
|
|
209
|
+
return __generator(this, function (_a) {
|
|
210
|
+
switch (_a.label) {
|
|
211
|
+
case 0:
|
|
212
|
+
entity = thunkApi.getState().entity;
|
|
213
|
+
payload = {
|
|
214
|
+
service_name: 'tap_email',
|
|
215
|
+
verify_token: entity.data.verify.token
|
|
216
|
+
};
|
|
217
|
+
return [4, API.leadService.verifyToken(payload)];
|
|
218
|
+
case 1:
|
|
219
|
+
data = _a.sent();
|
|
220
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
221
|
+
if (redirect)
|
|
222
|
+
thunkApi.dispatch(handleCurrentActiveScreen('ENTITY_SESSION_EXPIRED_OTP_STEP'));
|
|
223
|
+
return [2, { data: data }];
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}); });
|
|
227
|
+
export var verifyEntityLeadOTPSessionExpired = createAsyncThunk('entity/verifyEntityLeadOTPSessionExpired', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
228
|
+
var _a, entity, settings, session, responseBody, payload, data;
|
|
229
|
+
var _b, _c, _d;
|
|
230
|
+
return __generator(this, function (_e) {
|
|
231
|
+
switch (_e.label) {
|
|
232
|
+
case 0:
|
|
233
|
+
_a = thunkApi.getState(), entity = _a.entity, settings = _a.settings, session = _a.session;
|
|
234
|
+
responseBody = entity.data.verify.responseBody;
|
|
235
|
+
payload = {
|
|
236
|
+
data: params.otp,
|
|
237
|
+
service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
|
|
238
|
+
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
239
|
+
step_name: ENTITY_STEP_NAMES.PHONE_AUTH,
|
|
240
|
+
encryption_contract: ['data']
|
|
241
|
+
};
|
|
242
|
+
return [4, API.leadService.verifyTokenOTP(payload).catch(function (err) {
|
|
243
|
+
if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
|
|
244
|
+
thunkApi.dispatch(handleCurrentActiveScreen('ENTITY_OTP_VERIFY_SECURITY_ERROR_STEP'));
|
|
245
|
+
throw new Error(err === null || err === void 0 ? void 0 : err.message);
|
|
246
|
+
})];
|
|
247
|
+
case 1:
|
|
248
|
+
data = _e.sent();
|
|
249
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
250
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
|
|
251
|
+
thunkApi.dispatch(handleCurrentActiveScreen(session.data.nextScreen));
|
|
252
|
+
return [2, {
|
|
253
|
+
data: data,
|
|
254
|
+
formData: params
|
|
255
|
+
}];
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
}); });
|
|
207
259
|
export var retrieveBoardStatus = createAsyncThunk('entity/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
208
260
|
var entity, _a, board_id, board_info_id, recipient, _b, id, type, data;
|
|
209
261
|
return __generator(this, function (_c) {
|
|
@@ -658,6 +710,38 @@ export var entitySlice = createSlice({
|
|
|
658
710
|
state.loading = false;
|
|
659
711
|
if (!isAuthenticationVerificationFailed(message))
|
|
660
712
|
state.error = message;
|
|
713
|
+
})
|
|
714
|
+
.addCase(verifyLeadTokenSessionExpired.pending, function (state) {
|
|
715
|
+
state.error = null;
|
|
716
|
+
state.loading = true;
|
|
717
|
+
})
|
|
718
|
+
.addCase(verifyLeadTokenSessionExpired.fulfilled, function (state, action) {
|
|
719
|
+
state.error = null;
|
|
720
|
+
state.loading = false;
|
|
721
|
+
var data = action.payload.data;
|
|
722
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
723
|
+
})
|
|
724
|
+
.addCase(verifyLeadTokenSessionExpired.rejected, function (state, action) {
|
|
725
|
+
state.error = action.error.message;
|
|
726
|
+
state.loading = false;
|
|
727
|
+
})
|
|
728
|
+
.addCase(verifyEntityLeadOTPSessionExpired.pending, function (state) {
|
|
729
|
+
state.loading = true;
|
|
730
|
+
state.error = null;
|
|
731
|
+
})
|
|
732
|
+
.addCase(verifyEntityLeadOTPSessionExpired.fulfilled, function (state, action) {
|
|
733
|
+
state.loading = false;
|
|
734
|
+
state.error = null;
|
|
735
|
+
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
736
|
+
state.data.otpData = formData;
|
|
737
|
+
state.data.otpData.responseBody = data;
|
|
738
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
739
|
+
})
|
|
740
|
+
.addCase(verifyEntityLeadOTPSessionExpired.rejected, function (state, _a) {
|
|
741
|
+
var message = _a.error.message;
|
|
742
|
+
state.loading = false;
|
|
743
|
+
if (!isAuthenticationVerificationFailed(message))
|
|
744
|
+
state.error = message;
|
|
661
745
|
})
|
|
662
746
|
.addCase(updateEntityName.pending, function (state) {
|
|
663
747
|
state.loading = true;
|
|
@@ -74,6 +74,15 @@ export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
74
74
|
};
|
|
75
75
|
userList: User[] | undefined;
|
|
76
76
|
}, OTPFormValues, {}>;
|
|
77
|
+
export declare const verifyTokenSessionExpired: import("@reduxjs/toolkit").AsyncThunk<{
|
|
78
|
+
data: any;
|
|
79
|
+
}, boolean, {}>;
|
|
80
|
+
export declare const verifyLeadOTPSessionExpired: import("@reduxjs/toolkit").AsyncThunk<{
|
|
81
|
+
data: any;
|
|
82
|
+
formData: {
|
|
83
|
+
otp: string;
|
|
84
|
+
};
|
|
85
|
+
}, OTPFormValues, {}>;
|
|
77
86
|
export declare const updatePhoneInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
78
87
|
data: any;
|
|
79
88
|
formData: IndividualMobileFormValues;
|
|
@@ -69,7 +69,7 @@ var _a;
|
|
|
69
69
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
70
70
|
import API, { setAuthSessionToGlobalHeaders } from '../../../api';
|
|
71
71
|
import { FlowsTypes, IndividualGender, DocumentPurpose } from '../../../@types';
|
|
72
|
-
import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
72
|
+
import { handleCurrentActiveScreen, handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
73
73
|
import { defaultCountry, IDENTIFICATION_TYPE, INDIVIDUAl_STEP_NAMES, MONTHLY_INCOME_LIST } from '../../../constants';
|
|
74
74
|
import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose, formatNumberAsCurrency, removeAllCharsFromNumber, mapUserList, sortUserList, getIndividualType, isOtherThanKWOrSA, isKWOrSA, sendCustomEventToGTM, isAuthenticationVerificationFailed } from '../../../utils';
|
|
75
75
|
export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
|
|
@@ -533,6 +533,58 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
533
533
|
}
|
|
534
534
|
});
|
|
535
535
|
}); });
|
|
536
|
+
export var verifyTokenSessionExpired = createAsyncThunk('individual/verifyTokenSessionExpired', function (redirect, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
537
|
+
var individual, payload, data;
|
|
538
|
+
return __generator(this, function (_a) {
|
|
539
|
+
switch (_a.label) {
|
|
540
|
+
case 0:
|
|
541
|
+
individual = thunkApi.getState().individual;
|
|
542
|
+
payload = {
|
|
543
|
+
service_name: 'tap_email',
|
|
544
|
+
verify_token: individual.data.verify.token
|
|
545
|
+
};
|
|
546
|
+
return [4, API.leadService.verifyToken(payload)];
|
|
547
|
+
case 1:
|
|
548
|
+
data = _a.sent();
|
|
549
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
550
|
+
if (redirect)
|
|
551
|
+
thunkApi.dispatch(handleCurrentActiveScreen('INDIVIDUAL_SESSION_EXPIRED_OTP_STEP'));
|
|
552
|
+
return [2, { data: data }];
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
}); });
|
|
556
|
+
export var verifyLeadOTPSessionExpired = createAsyncThunk('individual/verifyLeadOTPSessionExpired', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
557
|
+
var _a, individual, settings, session, responseBody, payload, data;
|
|
558
|
+
var _b, _c, _d;
|
|
559
|
+
return __generator(this, function (_e) {
|
|
560
|
+
switch (_e.label) {
|
|
561
|
+
case 0:
|
|
562
|
+
_a = thunkApi.getState(), individual = _a.individual, settings = _a.settings, session = _a.session;
|
|
563
|
+
responseBody = individual.data.verify.responseBody;
|
|
564
|
+
payload = {
|
|
565
|
+
data: params.otp,
|
|
566
|
+
service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
|
|
567
|
+
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
568
|
+
step_name: INDIVIDUAl_STEP_NAMES.PHONE_AUTH,
|
|
569
|
+
encryption_contract: ['data']
|
|
570
|
+
};
|
|
571
|
+
return [4, API.leadService.verifyTokenOTP(payload).catch(function (err) {
|
|
572
|
+
if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
|
|
573
|
+
thunkApi.dispatch(handleCurrentActiveScreen('INDIVIDUAL_OTP_VERIFY_SECURITY_ERROR_STEP'));
|
|
574
|
+
throw new Error(err === null || err === void 0 ? void 0 : err.message);
|
|
575
|
+
})];
|
|
576
|
+
case 1:
|
|
577
|
+
data = _e.sent();
|
|
578
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
579
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
|
|
580
|
+
thunkApi.dispatch(handleCurrentActiveScreen(session.data.nextScreen));
|
|
581
|
+
return [2, {
|
|
582
|
+
data: data,
|
|
583
|
+
formData: __assign({}, params)
|
|
584
|
+
}];
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
}); });
|
|
536
588
|
export var updatePhoneInfo = createAsyncThunk('individual/updatePhoneInfo', function (_a, thunkApi) {
|
|
537
589
|
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
538
590
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1019,6 +1071,38 @@ export var individualSlice = createSlice({
|
|
|
1019
1071
|
state.loading = false;
|
|
1020
1072
|
if (!isAuthenticationVerificationFailed(message))
|
|
1021
1073
|
state.error = message;
|
|
1074
|
+
})
|
|
1075
|
+
.addCase(verifyTokenSessionExpired.pending, function (state) {
|
|
1076
|
+
state.error = null;
|
|
1077
|
+
state.loading = true;
|
|
1078
|
+
})
|
|
1079
|
+
.addCase(verifyTokenSessionExpired.fulfilled, function (state, action) {
|
|
1080
|
+
state.error = null;
|
|
1081
|
+
state.loading = false;
|
|
1082
|
+
var data = action.payload.data;
|
|
1083
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
1084
|
+
})
|
|
1085
|
+
.addCase(verifyTokenSessionExpired.rejected, function (state, action) {
|
|
1086
|
+
state.error = action.error.message;
|
|
1087
|
+
state.loading = false;
|
|
1088
|
+
})
|
|
1089
|
+
.addCase(verifyLeadOTPSessionExpired.pending, function (state) {
|
|
1090
|
+
state.loading = true;
|
|
1091
|
+
state.error = null;
|
|
1092
|
+
})
|
|
1093
|
+
.addCase(verifyLeadOTPSessionExpired.fulfilled, function (state, action) {
|
|
1094
|
+
state.loading = false;
|
|
1095
|
+
state.error = null;
|
|
1096
|
+
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
1097
|
+
state.data.otpData = formData;
|
|
1098
|
+
state.data.otpData.responseBody = data;
|
|
1099
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
1100
|
+
})
|
|
1101
|
+
.addCase(verifyLeadOTPSessionExpired.rejected, function (state, _a) {
|
|
1102
|
+
var message = _a.error.message;
|
|
1103
|
+
state.loading = false;
|
|
1104
|
+
if (!isAuthenticationVerificationFailed(message))
|
|
1105
|
+
state.error = message;
|
|
1022
1106
|
})
|
|
1023
1107
|
.addCase(addDetailsAsync.pending, function (state) {
|
|
1024
1108
|
state.addOrRequestDetailLoading = true;
|
|
@@ -25,6 +25,15 @@ export declare const verifyPasswordLeadOTP: import("@reduxjs/toolkit").AsyncThun
|
|
|
25
25
|
};
|
|
26
26
|
flows: any;
|
|
27
27
|
}, OTPFormValues, {}>;
|
|
28
|
+
export declare const verifyLeadTokenSessionExpired: import("@reduxjs/toolkit").AsyncThunk<{
|
|
29
|
+
data: any;
|
|
30
|
+
}, boolean, {}>;
|
|
31
|
+
export declare const verifyLeadOTPSessionExpired: import("@reduxjs/toolkit").AsyncThunk<{
|
|
32
|
+
data: any;
|
|
33
|
+
formData: {
|
|
34
|
+
otp: string;
|
|
35
|
+
};
|
|
36
|
+
}, OTPFormValues, {}>;
|
|
28
37
|
export declare const createPassword: import("@reduxjs/toolkit").AsyncThunk<{
|
|
29
38
|
data: any;
|
|
30
39
|
formData: PasswordCreateFormValues;
|
|
@@ -212,6 +212,55 @@ export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', fun
|
|
|
212
212
|
}
|
|
213
213
|
});
|
|
214
214
|
}); });
|
|
215
|
+
export var verifyLeadTokenSessionExpired = createAsyncThunk('password/verifyLeadTokenSessionExpired', function (redirect, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
216
|
+
var password, payload, data;
|
|
217
|
+
return __generator(this, function (_a) {
|
|
218
|
+
switch (_a.label) {
|
|
219
|
+
case 0:
|
|
220
|
+
password = thunkApi.getState().password;
|
|
221
|
+
payload = {
|
|
222
|
+
service_name: 'tap_email',
|
|
223
|
+
verify_token: password.data.verify.token
|
|
224
|
+
};
|
|
225
|
+
return [4, API.leadService.verifyToken(payload)];
|
|
226
|
+
case 1:
|
|
227
|
+
data = _a.sent();
|
|
228
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
229
|
+
if (redirect)
|
|
230
|
+
thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_SESSION_EXPIRED_OTP_STEP'));
|
|
231
|
+
return [2, { data: data }];
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}); });
|
|
235
|
+
export var verifyLeadOTPSessionExpired = createAsyncThunk('password/verifyLeadOTPSessionExpired', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
236
|
+
var _a, password, settings, session, responseBody, payload, data;
|
|
237
|
+
var _b, _c, _d;
|
|
238
|
+
return __generator(this, function (_e) {
|
|
239
|
+
switch (_e.label) {
|
|
240
|
+
case 0:
|
|
241
|
+
_a = thunkApi.getState(), password = _a.password, settings = _a.settings, session = _a.session;
|
|
242
|
+
responseBody = password.data.verify.responseBody;
|
|
243
|
+
payload = {
|
|
244
|
+
data: params.otp,
|
|
245
|
+
service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
|
|
246
|
+
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
247
|
+
step_name: PASSWORD_STEP_NAMES.PHONE_AUTH,
|
|
248
|
+
encryption_contract: ['data']
|
|
249
|
+
};
|
|
250
|
+
return [4, API.leadService.verifyTokenOTP(payload).catch(function (err) {
|
|
251
|
+
if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
|
|
252
|
+
thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_OTP_VERIFY_SECURITY_ERROR_STEP'));
|
|
253
|
+
throw new Error(err === null || err === void 0 ? void 0 : err.message);
|
|
254
|
+
})];
|
|
255
|
+
case 1:
|
|
256
|
+
data = _e.sent();
|
|
257
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
258
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
|
|
259
|
+
thunkApi.dispatch(handleCurrentActiveScreen(session.data.nextScreen));
|
|
260
|
+
return [2, { data: data, formData: __assign({}, params) }];
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
}); });
|
|
215
264
|
export var createPassword = createAsyncThunk('createPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
216
265
|
var _a, settings, password, requestBody, data;
|
|
217
266
|
var _b, _c, _d, _e;
|
|
@@ -520,6 +569,39 @@ export var passwordSlice = createSlice({
|
|
|
520
569
|
state.loading = false;
|
|
521
570
|
if (!isAuthenticationVerificationFailed(message))
|
|
522
571
|
state.error = message;
|
|
572
|
+
})
|
|
573
|
+
.addCase(verifyLeadTokenSessionExpired.fulfilled, function (state, action) {
|
|
574
|
+
state.data.verify.operationType = PASSWORD_OPERATION_TYPE.SET_PASSWORD;
|
|
575
|
+
state.error = null;
|
|
576
|
+
state.loading = false;
|
|
577
|
+
var data = action.payload.data;
|
|
578
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
579
|
+
})
|
|
580
|
+
.addCase(verifyLeadTokenSessionExpired.pending, function (state) {
|
|
581
|
+
state.loading = true;
|
|
582
|
+
state.error = null;
|
|
583
|
+
})
|
|
584
|
+
.addCase(verifyLeadTokenSessionExpired.rejected, function (state, action) {
|
|
585
|
+
state.error = action.error.message;
|
|
586
|
+
state.loading = false;
|
|
587
|
+
})
|
|
588
|
+
.addCase(verifyLeadOTPSessionExpired.pending, function (state) {
|
|
589
|
+
state.loading = true;
|
|
590
|
+
state.error = null;
|
|
591
|
+
})
|
|
592
|
+
.addCase(verifyLeadOTPSessionExpired.fulfilled, function (state, action) {
|
|
593
|
+
state.loading = false;
|
|
594
|
+
state.error = null;
|
|
595
|
+
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
596
|
+
state.data.otpData = formData;
|
|
597
|
+
state.data.otpData.responseBody = data;
|
|
598
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
599
|
+
})
|
|
600
|
+
.addCase(verifyLeadOTPSessionExpired.rejected, function (state, _a) {
|
|
601
|
+
var message = _a.error.message;
|
|
602
|
+
state.loading = false;
|
|
603
|
+
if (!isAuthenticationVerificationFailed(message))
|
|
604
|
+
state.error = message;
|
|
523
605
|
})
|
|
524
606
|
.addCase(createPassword.pending, function (state) {
|
|
525
607
|
state.loading = true;
|
|
@@ -26,6 +26,13 @@ export declare const verifyTaxLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
26
26
|
entityData: any;
|
|
27
27
|
formData: OTPFormValues;
|
|
28
28
|
}, OTPFormValues, {}>;
|
|
29
|
+
export declare const verifyLeadTokenSessionVerified: import("@reduxjs/toolkit").AsyncThunk<{
|
|
30
|
+
data: any;
|
|
31
|
+
}, boolean, {}>;
|
|
32
|
+
export declare const verifyLeadOTPSessionExpired: import("@reduxjs/toolkit").AsyncThunk<{
|
|
33
|
+
data: any;
|
|
34
|
+
formData: OTPFormValues;
|
|
35
|
+
}, OTPFormValues, {}>;
|
|
29
36
|
export declare const updateTaxInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
30
37
|
data: any;
|
|
31
38
|
formData: TaxFormValues;
|
|
@@ -229,6 +229,55 @@ export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (par
|
|
|
229
229
|
}
|
|
230
230
|
});
|
|
231
231
|
}); });
|
|
232
|
+
export var verifyLeadTokenSessionVerified = createAsyncThunk('tax/verifyLeadTokenSessionVerified', function (redirect, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
233
|
+
var tax, payload, data;
|
|
234
|
+
return __generator(this, function (_a) {
|
|
235
|
+
switch (_a.label) {
|
|
236
|
+
case 0:
|
|
237
|
+
tax = thunkApi.getState().tax;
|
|
238
|
+
payload = {
|
|
239
|
+
service_name: 'tap_email',
|
|
240
|
+
verify_token: tax.data.verify.token
|
|
241
|
+
};
|
|
242
|
+
return [4, API.leadService.verifyToken(payload)];
|
|
243
|
+
case 1:
|
|
244
|
+
data = _a.sent();
|
|
245
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
246
|
+
if (redirect)
|
|
247
|
+
thunkApi.dispatch(handleCurrentActiveScreen('TAX_SESSION_EXPIRED_OTP_STEP'));
|
|
248
|
+
return [2, { data: data }];
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
}); });
|
|
252
|
+
export var verifyLeadOTPSessionExpired = createAsyncThunk('tax/verifyLeadOTPSessionExpired', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
253
|
+
var _a, tax, settings, session, responseBody, payload, data;
|
|
254
|
+
var _b, _c, _d;
|
|
255
|
+
return __generator(this, function (_e) {
|
|
256
|
+
switch (_e.label) {
|
|
257
|
+
case 0:
|
|
258
|
+
_a = thunkApi.getState(), tax = _a.tax, settings = _a.settings, session = _a.session;
|
|
259
|
+
responseBody = tax.data.verify.responseBody;
|
|
260
|
+
payload = {
|
|
261
|
+
data: params.otp,
|
|
262
|
+
service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
|
|
263
|
+
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
264
|
+
step_name: TAX_STEP_NAMES.PHONE_AUTH,
|
|
265
|
+
encryption_contract: ['data']
|
|
266
|
+
};
|
|
267
|
+
return [4, API.leadService.verifyTokenOTP(payload).catch(function (err) {
|
|
268
|
+
if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
|
|
269
|
+
thunkApi.dispatch(handleCurrentActiveScreen('TAX_OTP_VERIFY_SECURITY_ERROR_STEP'));
|
|
270
|
+
throw new Error(err === null || err === void 0 ? void 0 : err.message);
|
|
271
|
+
})];
|
|
272
|
+
case 1:
|
|
273
|
+
data = _e.sent();
|
|
274
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
275
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
|
|
276
|
+
thunkApi.dispatch(handleCurrentActiveScreen(session.data.nextScreen));
|
|
277
|
+
return [2, { data: data, formData: params }];
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
}); });
|
|
232
281
|
export var updateTaxInfo = createAsyncThunk('updateTaxInfo', function (_a, thunkApi) {
|
|
233
282
|
var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
|
|
234
283
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -435,6 +484,38 @@ export var taxSlice = createSlice({
|
|
|
435
484
|
state.loading = false;
|
|
436
485
|
if (!isAuthenticationVerificationFailed(message))
|
|
437
486
|
state.error = message;
|
|
487
|
+
})
|
|
488
|
+
.addCase(verifyLeadTokenSessionVerified.fulfilled, function (state, action) {
|
|
489
|
+
state.error = null;
|
|
490
|
+
state.loading = false;
|
|
491
|
+
var data = action.payload.data;
|
|
492
|
+
state.data.verify.responseBody = __assign({}, data);
|
|
493
|
+
})
|
|
494
|
+
.addCase(verifyLeadTokenSessionVerified.pending, function (state) {
|
|
495
|
+
state.error = null;
|
|
496
|
+
state.loading = true;
|
|
497
|
+
})
|
|
498
|
+
.addCase(verifyLeadTokenSessionVerified.rejected, function (state, action) {
|
|
499
|
+
state.error = action.error.message;
|
|
500
|
+
state.loading = false;
|
|
501
|
+
})
|
|
502
|
+
.addCase(verifyLeadOTPSessionExpired.pending, function (state) {
|
|
503
|
+
state.loading = true;
|
|
504
|
+
state.error = null;
|
|
505
|
+
})
|
|
506
|
+
.addCase(verifyLeadOTPSessionExpired.fulfilled, function (state, action) {
|
|
507
|
+
state.loading = false;
|
|
508
|
+
state.error = null;
|
|
509
|
+
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
510
|
+
state.data.otpData = formData;
|
|
511
|
+
state.data.otpData.responseBody = data;
|
|
512
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
513
|
+
})
|
|
514
|
+
.addCase(verifyLeadOTPSessionExpired.rejected, function (state, _a) {
|
|
515
|
+
var message = _a.error.message;
|
|
516
|
+
state.loading = false;
|
|
517
|
+
if (!isAuthenticationVerificationFailed(message))
|
|
518
|
+
state.error = message;
|
|
438
519
|
})
|
|
439
520
|
.addCase(updateTaxInfo.pending, function (state) {
|
|
440
521
|
state.loading = true;
|
|
@@ -24,6 +24,15 @@ export declare const verifyTokenOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
24
24
|
formData: OTPFormValues;
|
|
25
25
|
nextScreen: string;
|
|
26
26
|
}, OTPFormValues, {}>;
|
|
27
|
+
export declare const verifyTokenSessionExpired: import("@reduxjs/toolkit").AsyncThunk<{
|
|
28
|
+
data: any;
|
|
29
|
+
nextScreen: string;
|
|
30
|
+
}, void, {}>;
|
|
31
|
+
export declare const verifyTokenOTPSessionExpired: import("@reduxjs/toolkit").AsyncThunk<{
|
|
32
|
+
data: any;
|
|
33
|
+
formData: OTPFormValues;
|
|
34
|
+
nextScreen: string;
|
|
35
|
+
}, OTPFormValues, {}>;
|
|
27
36
|
export declare const linkNewTerminal: import("@reduxjs/toolkit").AsyncThunk<{
|
|
28
37
|
data: any;
|
|
29
38
|
nextScreen: string;
|
|
@@ -171,6 +171,51 @@ export var verifyTokenOTP = createAsyncThunk('terminal/verifyOtp', function (par
|
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
173
|
}); });
|
|
174
|
+
export var verifyTokenSessionExpired = createAsyncThunk('terminal/verifyTokenSessionExpired', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
175
|
+
var terminal, payload, data;
|
|
176
|
+
return __generator(this, function (_a) {
|
|
177
|
+
switch (_a.label) {
|
|
178
|
+
case 0:
|
|
179
|
+
terminal = thunkApi.getState().terminal;
|
|
180
|
+
payload = {
|
|
181
|
+
service_name: 'tap_email',
|
|
182
|
+
verify_token: terminal.data.verify.token
|
|
183
|
+
};
|
|
184
|
+
return [4, API.leadService.verifyToken(payload)];
|
|
185
|
+
case 1:
|
|
186
|
+
data = _a.sent();
|
|
187
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
188
|
+
return [2, {
|
|
189
|
+
data: data,
|
|
190
|
+
nextScreen: CONNECT_FLOWS.terminal.otpSessionExpired
|
|
191
|
+
}];
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}); });
|
|
195
|
+
export var verifyTokenOTPSessionExpired = createAsyncThunk('terminal/verifyTokenOTPSessionExpired', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
196
|
+
var _a, terminal, settings, session, authData, payload, data;
|
|
197
|
+
var _b, _c, _d;
|
|
198
|
+
return __generator(this, function (_e) {
|
|
199
|
+
switch (_e.label) {
|
|
200
|
+
case 0:
|
|
201
|
+
_a = thunkApi.getState(), terminal = _a.terminal, settings = _a.settings, session = _a.session;
|
|
202
|
+
authData = (terminal.data.responseData || {}).authData;
|
|
203
|
+
payload = {
|
|
204
|
+
data: params.otp,
|
|
205
|
+
service_name: (_b = authData === null || authData === void 0 ? void 0 : authData.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
|
|
206
|
+
verify_token: authData === null || authData === void 0 ? void 0 : authData.verify_token,
|
|
207
|
+
step_name: TERMINAL_STEP_NAMES.PHONE_AUTH,
|
|
208
|
+
encryption_contract: ['data']
|
|
209
|
+
};
|
|
210
|
+
return [4, API.leadService.verifyTokenOTP(payload)];
|
|
211
|
+
case 1:
|
|
212
|
+
data = _e.sent();
|
|
213
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
214
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
|
|
215
|
+
return [2, { data: data, formData: params, nextScreen: session.data.nextScreen }];
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}); });
|
|
174
219
|
export var linkNewTerminal = createAsyncThunk('terminal/linkNewTerminal', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
175
220
|
var _a, _b, selectedPOS, responseData, _c, language, businessCountry, scope, authData, payload, data;
|
|
176
221
|
return __generator(this, function (_d) {
|
|
@@ -546,6 +591,37 @@ export var terminalSlice = createSlice({
|
|
|
546
591
|
state.loading = false;
|
|
547
592
|
if (!isAuthenticationVerificationFailed(message))
|
|
548
593
|
state.error = message;
|
|
594
|
+
})
|
|
595
|
+
.addCase(verifyTokenSessionExpired.pending, function (state) {
|
|
596
|
+
state.error = null;
|
|
597
|
+
state.loading = true;
|
|
598
|
+
})
|
|
599
|
+
.addCase(verifyTokenSessionExpired.fulfilled, function (state, action) {
|
|
600
|
+
state.error = null;
|
|
601
|
+
state.loading = false;
|
|
602
|
+
var data = (action.payload || {}).data;
|
|
603
|
+
state.data.responseData = { authData: data };
|
|
604
|
+
})
|
|
605
|
+
.addCase(verifyTokenSessionExpired.rejected, function (state, action) {
|
|
606
|
+
state.error = action.error.message;
|
|
607
|
+
state.loading = false;
|
|
608
|
+
})
|
|
609
|
+
.addCase(verifyTokenOTPSessionExpired.pending, function (state) {
|
|
610
|
+
state.loading = true;
|
|
611
|
+
state.error = null;
|
|
612
|
+
})
|
|
613
|
+
.addCase(verifyTokenOTPSessionExpired.fulfilled, function (state, action) {
|
|
614
|
+
state.loading = false;
|
|
615
|
+
state.error = null;
|
|
616
|
+
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
617
|
+
state.data.otpData = formData;
|
|
618
|
+
state.data.responseData = { authData: data };
|
|
619
|
+
})
|
|
620
|
+
.addCase(verifyTokenOTPSessionExpired.rejected, function (state, _a) {
|
|
621
|
+
var message = _a.error.message;
|
|
622
|
+
state.loading = false;
|
|
623
|
+
if (!isAuthenticationVerificationFailed(message))
|
|
624
|
+
state.error = message;
|
|
549
625
|
})
|
|
550
626
|
.addCase(linkNewTerminal.pending, function (state) {
|
|
551
627
|
state.loading = true;
|
|
@@ -39,7 +39,7 @@ var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
|
39
39
|
});
|
|
40
40
|
var OTPTitleStyled = styled(Text)(function (_a) {
|
|
41
41
|
var theme = _a.theme;
|
|
42
|
-
return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightLight, marginBlock: theme.spacing(1.75), marginInline: theme.spacing(2.5), lineHeight: 1.
|
|
42
|
+
return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightLight, marginBlock: theme.spacing(1.75), marginInline: theme.spacing(2.5), lineHeight: 1.5, whiteSpace: 'pre-line', display: 'flex', flexDirection: 'column' }));
|
|
43
43
|
});
|
|
44
44
|
var FormStyled = styled(Form)(function () { return ({
|
|
45
45
|
display: 'flex',
|
|
@@ -80,6 +80,6 @@ var OTP = function () {
|
|
|
80
80
|
var code = "+".concat((_a = data.mobileData.countryCode) === null || _a === void 0 ? void 0 : _a.idd_prefix, " ");
|
|
81
81
|
var phone = data.mobileData.mobile ? data.mobileData.mobile : '';
|
|
82
82
|
var title = t('session_expired_otp');
|
|
83
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : title, !loading && (_jsxs("span",
|
|
83
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : title, !loading && phone && (_jsxs("span", { children: [st('code_sent_to'), _jsxs("span", __assign({ dir: 'ltr' }, { children: [code, " ", maskPhone(phone)] }))] }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
|
|
84
84
|
};
|
|
85
85
|
export default React.memo(OTP);
|
|
@@ -23,7 +23,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
24
|
import React, { memo } from 'react';
|
|
25
25
|
import { createRoot } from 'react-dom/client';
|
|
26
|
-
import { useAppTheme, useAppSelector, useErrorListener, useAppConfig, useStepStartedListener, useVerifyToken, useAppDispatch } from '../../hooks';
|
|
26
|
+
import { useAppTheme, useAppSelector, useErrorListener, useAppConfig, useStepStartedListener, useVerifyToken, useAppDispatch, useSessionExpiryHandler } from '../../hooks';
|
|
27
27
|
import { handleOpen, settingsSelector } from '../../app/settings';
|
|
28
28
|
import AnimationFlow from '../../components/AnimationFlow';
|
|
29
29
|
import { store } from '../../app/store';
|
|
@@ -33,7 +33,7 @@ import { findOrCreateElementAndInject, initializeGTM, sendPageView } from '../..
|
|
|
33
33
|
import { FeatureContainer } from '../shared/Containers';
|
|
34
34
|
import { BANK_SCREENS_NAVIGATION } from '../../constants';
|
|
35
35
|
import { bankFeatureScreens } from '../featuresScreens';
|
|
36
|
-
import { bankSelector, verifyLeadToken } from '../app/bank/bankStore';
|
|
36
|
+
import { bankSelector, clearError, verifyLeadToken, verifyTokenSessionExpired } from '../app/bank/bankStore';
|
|
37
37
|
import Background from '../shared/Background';
|
|
38
38
|
var Bank = memo(function (_a) {
|
|
39
39
|
var _b, _c, _d;
|
|
@@ -45,6 +45,7 @@ var Bank = memo(function (_a) {
|
|
|
45
45
|
useAppConfig(__assign(__assign({ navigation: BANK_SCREENS_NAVIGATION }, props), { disableSettingFetching: props.mode === 'content' ? false : !!verifyToken || !!configToken }));
|
|
46
46
|
useErrorListener(bankError || error);
|
|
47
47
|
useStepStartedListener();
|
|
48
|
+
useSessionExpiryHandler({ error: bankError, clearError: clearError, createAuthSession: verifyTokenSessionExpired });
|
|
48
49
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open, featureScreensNavigation = data.featureScreensNavigation, merchant = data.merchant, isMaturityExpress = data.isMaturityExpress, appConfig = data.appConfig;
|
|
49
50
|
var animationDirection = open ? (_b = appConfig.features) === null || _b === void 0 ? void 0 : _b.dialogStartTransition : (_c = appConfig.features) === null || _c === void 0 ? void 0 : _c.dialogEndTransition;
|
|
50
51
|
React.useEffect(function () {
|