@tap-payments/auth-jsconnect 2.11.24-development → 2.11.27-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/@types/app.d.ts +1 -0
- package/build/api/auth.d.ts +2 -1
- package/build/api/axios.js +9 -1
- package/build/api/headers.d.ts +1 -0
- package/build/api/headers.js +15 -0
- package/build/api/index.d.ts +5 -4
- package/build/api/index.js +2 -1
- package/build/app/rootReducer.d.ts +1 -0
- package/build/app/rootReducer.js +2 -0
- package/build/app/session.d.ts +17 -0
- package/build/app/session.js +28 -0
- package/build/app/store.d.ts +2 -0
- package/build/assets/locales/ar.json +4 -1
- package/build/assets/locales/en.json +4 -1
- package/build/constants/app.d.ts +4 -0
- package/build/constants/app.js +37 -12
- package/build/constants/flows.d.ts +10 -22
- package/build/constants/flows.js +10 -23
- package/build/features/app/auth/authStore.js +7 -7
- package/build/features/app/bank/bankStore.js +3 -1
- package/build/features/app/board/boardStore.js +3 -1
- package/build/features/app/brand/brandStore.js +3 -1
- package/build/features/app/business/businessStore.js +3 -1
- package/build/features/app/connect/connectStore.d.ts +6 -0
- package/build/features/app/connect/connectStore.js +106 -11
- package/build/features/app/connectExpress/connectExpressStore.d.ts +4 -0
- package/build/features/app/connectExpress/connectExpressStore.js +105 -11
- package/build/features/app/entity/entityStore.js +3 -1
- package/build/features/app/individual/individualStore.js +3 -1
- package/build/features/app/kyc/kycStore.d.ts +5 -5
- package/build/features/app/kyc/kycStore.js +4 -1
- package/build/features/app/password/passwordStore.js +5 -1
- package/build/features/app/tax/taxStore.js +3 -1
- package/build/features/app/terminal/terminalStore.js +3 -1
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +2 -2
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +2 -2
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +2 -2
- package/build/features/business/screens/BusinessType/UnifiedNumber.d.ts +2 -2
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
- package/build/features/connect/Connect.js +3 -2
- package/build/features/connect/screens/OTPSessionExpired/OTPInput.d.ts +5 -0
- package/build/features/connect/screens/OTPSessionExpired/OTPInput.js +58 -0
- package/build/features/connect/screens/OTPSessionExpired/OTPSessionExpired.d.ts +3 -0
- package/build/features/connect/screens/OTPSessionExpired/OTPSessionExpired.js +86 -0
- package/build/features/connect/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/connect/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/connect/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/connect/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/connectExpress/ConnectExpress.js +3 -2
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.d.ts +2 -2
- package/build/features/connectExpress/screens/OTPSessionExpired/OTPInput.d.ts +3 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/OTPInput.js +58 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/OTPSessionExpired.js +85 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +2 -2
- package/build/features/featuresScreens.js +10 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -2
- package/build/features/shared/Address/CountryList.d.ts +1 -1
- package/build/features/shared/Address/InputSelect.d.ts +1 -1
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +1 -1
- package/build/features/terminal/screens/shared/styles.d.ts +1 -1
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useAppDispatch.d.ts +1 -0
- package/build/hooks/useSessionExpiryHandler.d.ts +8 -0
- package/build/hooks/useSessionExpiryHandler.js +71 -0
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/package.json +1 -1
|
@@ -66,7 +66,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
66
66
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
67
67
|
};
|
|
68
68
|
var _a;
|
|
69
|
-
import API, {
|
|
69
|
+
import API, { setAuthSessionToGlobalHeaders } from '../../../api';
|
|
70
70
|
import { handleCurrentActiveScreen, handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
71
71
|
import { COLLECT_DOB_INFO_NAFATH, CONNECT_STEP_NAMES, defaultCountry, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, OTHER_BRAND } from '../../../constants';
|
|
72
72
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
@@ -236,7 +236,7 @@ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params,
|
|
|
236
236
|
})];
|
|
237
237
|
case 1:
|
|
238
238
|
data = _f.sent();
|
|
239
|
-
|
|
239
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
240
240
|
sendCustomEventToGTM({
|
|
241
241
|
event: 'Send Event',
|
|
242
242
|
event_category: 'User Registration Flow',
|
|
@@ -286,6 +286,70 @@ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params,
|
|
|
286
286
|
}
|
|
287
287
|
});
|
|
288
288
|
}); });
|
|
289
|
+
export var createAuthSessionExpired = createAsyncThunk('createAuthSessionExpiredAsync', function (redirect, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
290
|
+
var settings, requestBody, data;
|
|
291
|
+
var _a, _b;
|
|
292
|
+
return __generator(this, function (_c) {
|
|
293
|
+
switch (_c.label) {
|
|
294
|
+
case 0:
|
|
295
|
+
settings = thunkApi.getState().settings;
|
|
296
|
+
requestBody = {
|
|
297
|
+
country: settings.data.businessCountry.iso2,
|
|
298
|
+
scope: settings.data.appConfig.scope,
|
|
299
|
+
lang: settings.data.language,
|
|
300
|
+
sign_in: false,
|
|
301
|
+
is_lead: true,
|
|
302
|
+
step_name: CONNECT_STEP_NAMES.CREATE_AUTH_SESSION_EXPIRED,
|
|
303
|
+
encryption_contract: []
|
|
304
|
+
};
|
|
305
|
+
return [4, API.authService.createAuth(requestBody)];
|
|
306
|
+
case 1:
|
|
307
|
+
data = _c.sent();
|
|
308
|
+
if (redirect)
|
|
309
|
+
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_SESSION_EXPIRED_OTP_STEP'));
|
|
310
|
+
(_b = (_a = settings.data.appConfig).onStepCompleted) === null || _b === void 0 ? void 0 : _b.call(_a, settings.data.activeScreen.name, requestBody);
|
|
311
|
+
return [2, { response: data }];
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
}); });
|
|
315
|
+
export var verifySessionExpiredOtp = createAsyncThunk('connect/verifySessionExpiredOtp', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
316
|
+
var _a, connect, settings, session, responseBody, payload, data;
|
|
317
|
+
var _b, _c;
|
|
318
|
+
return __generator(this, function (_d) {
|
|
319
|
+
switch (_d.label) {
|
|
320
|
+
case 0:
|
|
321
|
+
_a = thunkApi.getState(), connect = _a.connect, settings = _a.settings, session = _a.session;
|
|
322
|
+
responseBody = connect.data.mobileData.responseBody;
|
|
323
|
+
payload = {
|
|
324
|
+
data: params.otp,
|
|
325
|
+
auth_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token,
|
|
326
|
+
auth_type: responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_type,
|
|
327
|
+
device_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.device_token,
|
|
328
|
+
service_name: responseBody === null || responseBody === void 0 ? void 0 : responseBody.service_name,
|
|
329
|
+
sign_in: responseBody === null || responseBody === void 0 ? void 0 : responseBody.sign_in,
|
|
330
|
+
remember_me: responseBody === null || responseBody === void 0 ? void 0 : responseBody.remember_me,
|
|
331
|
+
step_name: CONNECT_STEP_NAMES.VERIFY_AUTH_SESSION_EXPIRED,
|
|
332
|
+
encryption_contract: ['data']
|
|
333
|
+
};
|
|
334
|
+
return [4, API.authService.verifyAuth(payload).catch(function (err) {
|
|
335
|
+
if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
|
|
336
|
+
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_OTP_VERIFY_SECURITY_ERROR_STEP'));
|
|
337
|
+
throw new Error(err === null || err === void 0 ? void 0 : err.message);
|
|
338
|
+
})];
|
|
339
|
+
case 1:
|
|
340
|
+
data = _d.sent();
|
|
341
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
342
|
+
sendCustomEventToGTM({
|
|
343
|
+
event: 'Send Event',
|
|
344
|
+
event_category: 'User Registration Flow',
|
|
345
|
+
event_action: 'Session Expired - OTP Success'
|
|
346
|
+
});
|
|
347
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, { otp: params.otp });
|
|
348
|
+
thunkApi.dispatch(handleCurrentActiveScreen(session.data.nextScreen));
|
|
349
|
+
return [2, { data: data }];
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
}); });
|
|
289
353
|
export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
290
354
|
var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, error_1, isSuccess, lead_id, leadResponse, countryCode, channels, brand, err_3, brands, err_4, phone;
|
|
291
355
|
var _b, _c, _d, _e, _f;
|
|
@@ -321,7 +385,7 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
|
|
|
321
385
|
case 5:
|
|
322
386
|
isSuccess = ((_b = authResponse === null || authResponse === void 0 ? void 0 : authResponse.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
323
387
|
if (!isSuccess) return [3, 16];
|
|
324
|
-
|
|
388
|
+
setAuthSessionToGlobalHeaders(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_session);
|
|
325
389
|
lead_id = authResponse.lead_id;
|
|
326
390
|
if (!lead_id)
|
|
327
391
|
throw new Error('Lead id is missing');
|
|
@@ -419,7 +483,7 @@ export var verifyNafath = createAsyncThunk('connect/verifyNafath', function (par
|
|
|
419
483
|
return [2, { authResponse: authResponse, countryCode: countryCode }];
|
|
420
484
|
}
|
|
421
485
|
if (!isSuccess) return [3, 16];
|
|
422
|
-
|
|
486
|
+
setAuthSessionToGlobalHeaders(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_session);
|
|
423
487
|
lead_id = authResponse.lead_id;
|
|
424
488
|
if (!lead_id)
|
|
425
489
|
throw new Error('Lead id is missing');
|
|
@@ -769,9 +833,9 @@ export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', f
|
|
|
769
833
|
var email = _a.email, cancelToken = _a.cancelToken, onSuccess = _a.onSuccess;
|
|
770
834
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
771
835
|
var responseBody, requestBody, data, retryData;
|
|
772
|
-
var _b, _c, _d, _e;
|
|
773
|
-
return __generator(this, function (
|
|
774
|
-
switch (
|
|
836
|
+
var _b, _c, _d, _e, _f, _g;
|
|
837
|
+
return __generator(this, function (_h) {
|
|
838
|
+
switch (_h.label) {
|
|
775
839
|
case 0:
|
|
776
840
|
responseBody = thunkApi.getState().connect.data.otpData.responseBody;
|
|
777
841
|
requestBody = {
|
|
@@ -781,22 +845,22 @@ export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', f
|
|
|
781
845
|
};
|
|
782
846
|
return [4, API.availabilityServices.checkEmail(requestBody, { cancelToken: cancelToken })];
|
|
783
847
|
case 1:
|
|
784
|
-
data = (
|
|
848
|
+
data = (_h.sent()).data;
|
|
785
849
|
if (!data.errors) {
|
|
786
850
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
787
851
|
return [2, { response: data, formData: email }];
|
|
788
852
|
}
|
|
789
853
|
if (!isInternalServerError((_d = (_c = data.errors) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.error)) {
|
|
790
854
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
791
|
-
|
|
855
|
+
throw new Error((_f = (_e = data.errors) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.error);
|
|
792
856
|
}
|
|
793
857
|
return [4, API.availabilityServices.checkEmail(requestBody, { cancelToken: cancelToken })];
|
|
794
858
|
case 2:
|
|
795
|
-
retryData = (
|
|
859
|
+
retryData = (_h.sent()).data;
|
|
796
860
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
797
861
|
if (!retryData.errors)
|
|
798
862
|
return [2, { response: retryData, formData: email }];
|
|
799
|
-
if (isInternalServerError((
|
|
863
|
+
if (isInternalServerError((_g = retryData.errors) === null || _g === void 0 ? void 0 : _g[0].error))
|
|
800
864
|
return [2, { response: { is_available: true }, formData: email }];
|
|
801
865
|
return [2];
|
|
802
866
|
}
|
|
@@ -1145,6 +1209,37 @@ export var connectSlice = createSlice({
|
|
|
1145
1209
|
state.loading = false;
|
|
1146
1210
|
if (!isAuthenticationVerificationFailed(message))
|
|
1147
1211
|
state.error = message;
|
|
1212
|
+
})
|
|
1213
|
+
.addCase(createAuthSessionExpired.fulfilled, function (state, action) {
|
|
1214
|
+
state.loading = false;
|
|
1215
|
+
state.error = null;
|
|
1216
|
+
var response = action.payload.response;
|
|
1217
|
+
state.data.mobileData.responseBody = response;
|
|
1218
|
+
state.data.otpData.authFor = AuthForType.MOBILE;
|
|
1219
|
+
})
|
|
1220
|
+
.addCase(createAuthSessionExpired.pending, function (state) {
|
|
1221
|
+
state.loading = true;
|
|
1222
|
+
state.error = null;
|
|
1223
|
+
})
|
|
1224
|
+
.addCase(createAuthSessionExpired.rejected, function (state, action) {
|
|
1225
|
+
state.loading = false;
|
|
1226
|
+
state.error = action.error.message;
|
|
1227
|
+
})
|
|
1228
|
+
.addCase(verifySessionExpiredOtp.fulfilled, function (state, action) {
|
|
1229
|
+
state.loading = false;
|
|
1230
|
+
state.error = null;
|
|
1231
|
+
var data = action.payload.data;
|
|
1232
|
+
state.data.otpData.responseBody = __assign({}, data);
|
|
1233
|
+
})
|
|
1234
|
+
.addCase(verifySessionExpiredOtp.pending, function (state) {
|
|
1235
|
+
state.loading = true;
|
|
1236
|
+
state.error = null;
|
|
1237
|
+
})
|
|
1238
|
+
.addCase(verifySessionExpiredOtp.rejected, function (state, _a) {
|
|
1239
|
+
var message = _a.error.message;
|
|
1240
|
+
state.loading = false;
|
|
1241
|
+
if (!isAuthenticationVerificationFailed(message))
|
|
1242
|
+
state.error = message;
|
|
1148
1243
|
})
|
|
1149
1244
|
.addCase(updateLeadDOB.fulfilled, function (state, action) {
|
|
1150
1245
|
state.loading = false;
|
|
@@ -37,6 +37,10 @@ export declare const resendMobileAuthOTP: import("@reduxjs/toolkit").AsyncThunk<
|
|
|
37
37
|
response: any;
|
|
38
38
|
formData: MobileFormValues;
|
|
39
39
|
}, MobileFormValues, {}>;
|
|
40
|
+
export declare const createAuthSessionExpiredAsync: import("@reduxjs/toolkit").AsyncThunk<{
|
|
41
|
+
data: any;
|
|
42
|
+
}, boolean, {}>;
|
|
43
|
+
export declare const verifySessionExpiredOtpAsync: import("@reduxjs/toolkit").AsyncThunk<any, OTPFormValues, {}>;
|
|
40
44
|
export declare const createNafathAuth: import("@reduxjs/toolkit").AsyncThunk<{
|
|
41
45
|
response: any;
|
|
42
46
|
formData: {
|
|
@@ -58,7 +58,7 @@ var _a;
|
|
|
58
58
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
59
59
|
import { handleNextScreenStep, handleCurrentActiveScreen, handleOpen, handleSetCountryByIso2, onCloseComplete, storeAuthId } from '../../../app/settings';
|
|
60
60
|
import { FlowsTypes, AuthForType, BusinessType, LicenseType, AuthForScreen } from '../../../@types';
|
|
61
|
-
import API, {
|
|
61
|
+
import API, { setAuthSessionToGlobalHeaders } from '../../../api';
|
|
62
62
|
import { ADD_NEW_ENTITY, COLLECT_DOB_INFO_NAFATH, CONNECT_EXPRESS_STEP_NAMES, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_FL_LICENSE, SCOPE_AUTH, SCOPE_MERCHANT } from '../../../constants';
|
|
63
63
|
import { defaultCountry } from '../../../constants';
|
|
64
64
|
import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA, isKW, isOtherThanKWOrSA, sendCustomEventToGTM, sendCustomDimension, getMetaData, isNetworkError, isTimeoutError, isInternalServerError, isAuthenticationVerificationFailed } from '../../../utils';
|
|
@@ -309,6 +309,71 @@ export var resendMobileAuthOTP = createAsyncThunk('connectExpress/resendMobileAu
|
|
|
309
309
|
}
|
|
310
310
|
});
|
|
311
311
|
}); });
|
|
312
|
+
export var createAuthSessionExpiredAsync = createAsyncThunk('connectExpress/createAuthSessionExpiredAsync', function (redirect, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
313
|
+
var settings, requestBody, data;
|
|
314
|
+
return __generator(this, function (_a) {
|
|
315
|
+
switch (_a.label) {
|
|
316
|
+
case 0:
|
|
317
|
+
settings = thunkApi.getState().settings;
|
|
318
|
+
requestBody = {
|
|
319
|
+
country: settings.data.businessCountry.iso2,
|
|
320
|
+
scope: settings.data.appConfig.scope,
|
|
321
|
+
lang: settings.data.language,
|
|
322
|
+
step_name: CONNECT_EXPRESS_STEP_NAMES.CREATE_AUTH_SESSION_EXPIRED,
|
|
323
|
+
encryption_contract: []
|
|
324
|
+
};
|
|
325
|
+
return [4, API.authService.createExpressAuth(requestBody)];
|
|
326
|
+
case 1:
|
|
327
|
+
data = _a.sent();
|
|
328
|
+
if (redirect)
|
|
329
|
+
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_SESSION_EXPIRED_OTP_STEP'));
|
|
330
|
+
return [2, { data: data }];
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
}); });
|
|
334
|
+
export var verifySessionExpiredOtpAsync = createAsyncThunk('connectExpress/verifySessionExpiredOtpAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
335
|
+
var _a, settings, connectExpress, session, _b, responseData, leadId, _c, auth_token, device_token, service_name, payload, data, authId;
|
|
336
|
+
var _d, _e;
|
|
337
|
+
return __generator(this, function (_f) {
|
|
338
|
+
switch (_f.label) {
|
|
339
|
+
case 0:
|
|
340
|
+
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress, session = _a.session;
|
|
341
|
+
_b = connectExpress.data || {}, responseData = _b.responseData, leadId = _b.leadId;
|
|
342
|
+
if (!(responseData === null || responseData === void 0 ? void 0 : responseData.authData))
|
|
343
|
+
throw new Error('Auth data is missing');
|
|
344
|
+
_c = responseData.authData, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name;
|
|
345
|
+
payload = {
|
|
346
|
+
auth_token: auth_token,
|
|
347
|
+
lead_id: leadId,
|
|
348
|
+
data: params.otp,
|
|
349
|
+
auth_type: 2,
|
|
350
|
+
device_token: device_token,
|
|
351
|
+
service_name: service_name,
|
|
352
|
+
sign_in: false,
|
|
353
|
+
step_name: CONNECT_EXPRESS_STEP_NAMES.VERIFY_AUTH_SESSION_EXPIRED,
|
|
354
|
+
encryption_contract: ['data']
|
|
355
|
+
};
|
|
356
|
+
return [4, API.authService.verifyExpressAuth(payload).catch(function (err) {
|
|
357
|
+
if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
|
|
358
|
+
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_OTP_VERIFY_SECURITY_ERROR_STEP'));
|
|
359
|
+
throw new Error(err === null || err === void 0 ? void 0 : err.message);
|
|
360
|
+
})];
|
|
361
|
+
case 1:
|
|
362
|
+
data = _f.sent();
|
|
363
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
364
|
+
sendCustomEventToGTM({
|
|
365
|
+
event: 'Send Event',
|
|
366
|
+
event_category: 'User Registration Flow',
|
|
367
|
+
event_action: 'Session Expired - OTP Success'
|
|
368
|
+
});
|
|
369
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, params);
|
|
370
|
+
authId = data.auth.id;
|
|
371
|
+
thunkApi.dispatch(storeAuthId(authId));
|
|
372
|
+
thunkApi.dispatch(handleCurrentActiveScreen(session.data.nextScreen));
|
|
373
|
+
return [2, data];
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
}); });
|
|
312
377
|
export var createNafathAuth = createAsyncThunk('connectExpress/createNafathAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
313
378
|
var _a, settings, connectExpress, requestBody, data;
|
|
314
379
|
var _b, _c;
|
|
@@ -385,7 +450,7 @@ export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsyn
|
|
|
385
450
|
return [2, { data: data }];
|
|
386
451
|
}
|
|
387
452
|
if (!isSuccess) return [3, 9];
|
|
388
|
-
|
|
453
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
389
454
|
authId = (_j = data.auth) === null || _j === void 0 ? void 0 : _j.id;
|
|
390
455
|
leadId = (_k = data.auth) === null || _k === void 0 ? void 0 : _k.lead_id;
|
|
391
456
|
thunkApi.dispatch(storeAuthId(authId));
|
|
@@ -507,7 +572,7 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
|
|
|
507
572
|
})];
|
|
508
573
|
case 1:
|
|
509
574
|
data = _h.sent();
|
|
510
|
-
|
|
575
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
511
576
|
sendCustomEventToGTM({
|
|
512
577
|
event: 'Send Event',
|
|
513
578
|
event_category: 'User Registration Flow',
|
|
@@ -589,7 +654,7 @@ export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync',
|
|
|
589
654
|
case 5:
|
|
590
655
|
isSuccess = ((_e = (_d = data === null || data === void 0 ? void 0 : data.auth) === null || _d === void 0 ? void 0 : _d.status) === null || _e === void 0 ? void 0 : _e.toLowerCase()) === 'success';
|
|
591
656
|
if (!isSuccess) return [3, 9];
|
|
592
|
-
|
|
657
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
593
658
|
authId = data.auth.id;
|
|
594
659
|
thunkApi.dispatch(storeAuthId(authId));
|
|
595
660
|
if (isScopeAuthentication && !data.new_user && isDataHasIndividualOnly && authId) {
|
|
@@ -846,9 +911,9 @@ export var checkEmailAvailabilityAsync = createAsyncThunk('connectExpress/CheckE
|
|
|
846
911
|
var email = _a.email, cancelToken = _a.cancelToken, onSuccess = _a.onSuccess;
|
|
847
912
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
848
913
|
var responseData, requestBody, data, retryData;
|
|
849
|
-
var _b, _c, _d, _e, _f;
|
|
850
|
-
return __generator(this, function (
|
|
851
|
-
switch (
|
|
914
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
|
915
|
+
return __generator(this, function (_j) {
|
|
916
|
+
switch (_j.label) {
|
|
852
917
|
case 0:
|
|
853
918
|
responseData = thunkApi.getState().connectExpress.data.responseData;
|
|
854
919
|
requestBody = {
|
|
@@ -858,22 +923,22 @@ export var checkEmailAvailabilityAsync = createAsyncThunk('connectExpress/CheckE
|
|
|
858
923
|
};
|
|
859
924
|
return [4, API.availabilityServices.checkEmail(requestBody, { cancelToken: cancelToken })];
|
|
860
925
|
case 1:
|
|
861
|
-
data = (
|
|
926
|
+
data = (_j.sent()).data;
|
|
862
927
|
if (!data.errors) {
|
|
863
928
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
864
929
|
return [2, { response: data, formData: email }];
|
|
865
930
|
}
|
|
866
931
|
if (!isInternalServerError((_d = (_c = data.errors) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.error)) {
|
|
867
932
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
868
|
-
|
|
933
|
+
throw new Error((_f = (_e = data.errors) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.error);
|
|
869
934
|
}
|
|
870
935
|
return [4, API.availabilityServices.checkEmail(requestBody, { cancelToken: cancelToken })];
|
|
871
936
|
case 2:
|
|
872
|
-
retryData = (
|
|
937
|
+
retryData = (_j.sent()).data;
|
|
873
938
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
874
939
|
if (!retryData.errors)
|
|
875
940
|
return [2, { response: retryData, formData: email }];
|
|
876
|
-
if (isInternalServerError((
|
|
941
|
+
if (isInternalServerError((_h = (_g = retryData.errors) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.error))
|
|
877
942
|
return [2, { response: { is_available: true }, formData: email }];
|
|
878
943
|
return [2];
|
|
879
944
|
}
|
|
@@ -1653,6 +1718,35 @@ export var connectSlice = createSlice({
|
|
|
1653
1718
|
})
|
|
1654
1719
|
.addCase(resendMobileAuthOTP.rejected, function (state, action) {
|
|
1655
1720
|
state.error = action.error.message;
|
|
1721
|
+
})
|
|
1722
|
+
.addCase(createAuthSessionExpiredAsync.pending, function (state) {
|
|
1723
|
+
state.loading = true;
|
|
1724
|
+
state.error = null;
|
|
1725
|
+
})
|
|
1726
|
+
.addCase(createAuthSessionExpiredAsync.fulfilled, function (state, _a) {
|
|
1727
|
+
var data = _a.payload.data;
|
|
1728
|
+
state.loading = false;
|
|
1729
|
+
state.data.otpData.authFor = AuthForType.MOBILE;
|
|
1730
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { authData: data });
|
|
1731
|
+
})
|
|
1732
|
+
.addCase(createAuthSessionExpiredAsync.rejected, function (state, action) {
|
|
1733
|
+
state.loading = false;
|
|
1734
|
+
state.error = action.error.message;
|
|
1735
|
+
})
|
|
1736
|
+
.addCase(verifySessionExpiredOtpAsync.pending, function (state) {
|
|
1737
|
+
state.loading = true;
|
|
1738
|
+
state.error = null;
|
|
1739
|
+
})
|
|
1740
|
+
.addCase(verifySessionExpiredOtpAsync.fulfilled, function (state, action) {
|
|
1741
|
+
var _a;
|
|
1742
|
+
state.loading = false;
|
|
1743
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { authData: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authData), action.payload) });
|
|
1744
|
+
})
|
|
1745
|
+
.addCase(verifySessionExpiredOtpAsync.rejected, function (state, _a) {
|
|
1746
|
+
var message = _a.error.message;
|
|
1747
|
+
state.loading = false;
|
|
1748
|
+
if (!isAuthenticationVerificationFailed(message))
|
|
1749
|
+
state.error = message;
|
|
1656
1750
|
})
|
|
1657
1751
|
.addCase(createNafathAuth.fulfilled, function (state, action) {
|
|
1658
1752
|
state.loading = false;
|
|
@@ -58,7 +58,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
58
58
|
};
|
|
59
59
|
var _a;
|
|
60
60
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
61
|
-
import API from '../../../api';
|
|
61
|
+
import API, { setAuthSessionToGlobalHeaders } from '../../../api';
|
|
62
62
|
import { BusinessType, DocumentPurpose, FlowsTypes, LicenseType } from '../../../@types';
|
|
63
63
|
import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
64
64
|
import { ENTITY_STEP_NAMES } from '../../../constants';
|
|
@@ -85,6 +85,7 @@ export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function
|
|
|
85
85
|
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
86
86
|
if (isInternally)
|
|
87
87
|
data.step_name = ENTITY_STEP_NAMES.ENTITY_INFO;
|
|
88
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
88
89
|
_b = data || {}, country_code = _b.country_code, config = _b.config;
|
|
89
90
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
90
91
|
if (country_code)
|
|
@@ -165,6 +166,7 @@ export var verifyEntityLeadOTP = createAsyncThunk('verifyEntityLeadOTP', functio
|
|
|
165
166
|
})];
|
|
166
167
|
case 1:
|
|
167
168
|
data = _h.sent();
|
|
169
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
168
170
|
_b = data || {}, entity_id = _b.entity_id, config = _b.config, boardId = _b.id, country_code = _b.country_code;
|
|
169
171
|
entityData = undefined;
|
|
170
172
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
@@ -67,7 +67,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
67
67
|
};
|
|
68
68
|
var _a;
|
|
69
69
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
70
|
-
import API from '../../../api';
|
|
70
|
+
import API, { setAuthSessionToGlobalHeaders } from '../../../api';
|
|
71
71
|
import { FlowsTypes, IndividualGender, DocumentPurpose } from '../../../@types';
|
|
72
72
|
import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
73
73
|
import { defaultCountry, IDENTIFICATION_TYPE, INDIVIDUAl_STEP_NAMES, MONTHLY_INCOME_LIST } from '../../../constants';
|
|
@@ -93,6 +93,7 @@ export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a
|
|
|
93
93
|
countries = settings.data.countries;
|
|
94
94
|
if (((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
|
|
95
95
|
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
96
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
96
97
|
if (isInternally)
|
|
97
98
|
data.step_name = INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO;
|
|
98
99
|
_b = data || {}, country_code = _b.country_code, config = _b.config, boardId = _b.id;
|
|
@@ -466,6 +467,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
|
|
|
466
467
|
})];
|
|
467
468
|
case 1:
|
|
468
469
|
data = _l.sent();
|
|
470
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
469
471
|
recipientData = undefined;
|
|
470
472
|
publicKey = (_e = data === null || data === void 0 ? void 0 : data.config) === null || _e === void 0 ? void 0 : _e.public_key;
|
|
471
473
|
countryCode = data === null || data === void 0 ? void 0 : data.country_code;
|
|
@@ -7,15 +7,15 @@ export declare const verifyTokenApi: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
7
7
|
data: any;
|
|
8
8
|
userList: any;
|
|
9
9
|
token: string;
|
|
10
|
-
nextScreen:
|
|
10
|
+
nextScreen: string;
|
|
11
11
|
}, VerifyLeadTokenProps, {}>;
|
|
12
12
|
export declare const createPaciAuth: import("@reduxjs/toolkit").AsyncThunk<{
|
|
13
13
|
data: any;
|
|
14
|
-
nextScreen:
|
|
14
|
+
nextScreen: string;
|
|
15
15
|
}, User, {}>;
|
|
16
16
|
export declare const createNafathAuth: import("@reduxjs/toolkit").AsyncThunk<{
|
|
17
17
|
data: any;
|
|
18
|
-
nextScreen:
|
|
18
|
+
nextScreen: string;
|
|
19
19
|
}, User, {}>;
|
|
20
20
|
interface verifyNafathParams {
|
|
21
21
|
onSuccess: () => void;
|
|
@@ -27,7 +27,7 @@ export declare const verifyNafath: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
27
27
|
nextScreen?: undefined;
|
|
28
28
|
} | {
|
|
29
29
|
data: any;
|
|
30
|
-
nextScreen:
|
|
30
|
+
nextScreen: string;
|
|
31
31
|
createAuthData: any;
|
|
32
32
|
}, verifyNafathParams, {}>;
|
|
33
33
|
interface verifyPACIParams {
|
|
@@ -35,7 +35,7 @@ interface verifyPACIParams {
|
|
|
35
35
|
}
|
|
36
36
|
export declare const verifyPaci: import("@reduxjs/toolkit").AsyncThunk<{
|
|
37
37
|
data: any;
|
|
38
|
-
nextScreen:
|
|
38
|
+
nextScreen: string;
|
|
39
39
|
createAuthData: any;
|
|
40
40
|
}, verifyPACIParams, {}>;
|
|
41
41
|
export declare const updateKYCSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
@@ -50,7 +50,7 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
|
50
50
|
import { handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
52
|
import { CONNECT_FLOWS, KYC_STEP_NAMES, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED } from '../../../constants';
|
|
53
|
-
import API from '../../../api';
|
|
53
|
+
import API, { setAuthSessionToGlobalHeaders } from '../../../api';
|
|
54
54
|
import { isNetworkError, isTimeoutError, sendCustomEventToGTM, sleep } from '../../../utils';
|
|
55
55
|
export var verifyTokenApi = createAsyncThunk('kyc/verifyTokenApi', function (_a, thunkApi) {
|
|
56
56
|
var token = _a.token;
|
|
@@ -70,6 +70,7 @@ export var verifyTokenApi = createAsyncThunk('kyc/verifyTokenApi', function (_a,
|
|
|
70
70
|
return [4, API.leadService.verifyToken(payload)];
|
|
71
71
|
case 1:
|
|
72
72
|
data = _d.sent();
|
|
73
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
73
74
|
_b = data || {}, config = _b.config, country_code = _b.country_code, segment_id = _b.segment_id, boardId = _b.id, boardInfoId = _b.board_info_id;
|
|
74
75
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
75
76
|
return [4, API.boardService.retrieveBoardInfo({ id: boardId, infoId: boardInfoId })];
|
|
@@ -200,6 +201,7 @@ export var verifyNafath = createAsyncThunk('kyc/verifyNafath', function (params,
|
|
|
200
201
|
return [2, { data: data, createAuthData: createAuthData }];
|
|
201
202
|
}
|
|
202
203
|
if (!isSuccess) return [3, 7];
|
|
204
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
203
205
|
(_d = params.onSuccess) === null || _d === void 0 ? void 0 : _d.call(params);
|
|
204
206
|
return [4, thunkApi.dispatch(updateKYCSuccess())];
|
|
205
207
|
case 6:
|
|
@@ -252,6 +254,7 @@ export var verifyPaci = createAsyncThunk('kyc/verifyPaci', function (params, thu
|
|
|
252
254
|
case 5:
|
|
253
255
|
isSuccess = ((_a = data === null || data === void 0 ? void 0 : data.status) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'success';
|
|
254
256
|
if (!isSuccess) return [3, 7];
|
|
257
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
255
258
|
(_b = params.onSuccess) === null || _b === void 0 ? void 0 : _b.call(params);
|
|
256
259
|
return [4, thunkApi.dispatch(updateKYCSuccess())];
|
|
257
260
|
case 6:
|
|
@@ -47,7 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
var _a;
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
|
-
import API from '../../../api';
|
|
50
|
+
import API, { setAuthSessionToGlobalHeaders } from '../../../api';
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
52
|
import { handleCurrentActiveScreen, handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
53
53
|
import { PASSWORD_OPERATION_TYPE, PASSWORD_STEP_NAMES } from '../../../constants';
|
|
@@ -72,6 +72,7 @@ export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', functio
|
|
|
72
72
|
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
73
73
|
if (isInternally)
|
|
74
74
|
data.step_name = PASSWORD_STEP_NAMES.PASSWORD_INFO;
|
|
75
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
75
76
|
_b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.id, recipient = _b.recipient;
|
|
76
77
|
countryIso2 = country_code;
|
|
77
78
|
if (countryIso2)
|
|
@@ -177,6 +178,7 @@ export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', fun
|
|
|
177
178
|
case 1:
|
|
178
179
|
data = _g.sent();
|
|
179
180
|
_b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.id, recipient = _b.recipient;
|
|
181
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
180
182
|
countryIso2 = country_code;
|
|
181
183
|
if (countryIso2)
|
|
182
184
|
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
@@ -310,6 +312,7 @@ export var verifyOperationToken = createAsyncThunk('verifyOperationToken', funct
|
|
|
310
312
|
return [4, API.authService.verifyAuth(payload)];
|
|
311
313
|
case 1:
|
|
312
314
|
data = _c.sent();
|
|
315
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
313
316
|
countryIso2 = data === null || data === void 0 ? void 0 : data.country;
|
|
314
317
|
if (countryIso2)
|
|
315
318
|
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
@@ -378,6 +381,7 @@ export var resetPassword = createAsyncThunk('resetPassword', function (params, t
|
|
|
378
381
|
})];
|
|
379
382
|
case 1:
|
|
380
383
|
data = _d.sent();
|
|
384
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
381
385
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_STEP')); });
|
|
382
386
|
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, payload);
|
|
383
387
|
return [2, { data: data, formData: __assign(__assign({}, params), passwordData) }];
|
|
@@ -47,7 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
var _a;
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
|
-
import API from '../../../api';
|
|
50
|
+
import API, { setAuthSessionToGlobalHeaders } from '../../../api';
|
|
51
51
|
import { DocumentPurpose, FlowsTypes } from '../../../@types';
|
|
52
52
|
import { handleNextScreenStep, handleCurrentActiveScreen, handleSetCountryByIso2, handlePrevScreenStep, handlePublicKey, onCloseComplete } from '../../../app/settings';
|
|
53
53
|
import { TAX_STEP_NAMES } from '../../../constants';
|
|
@@ -73,6 +73,7 @@ export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a
|
|
|
73
73
|
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
74
74
|
if (isInternally)
|
|
75
75
|
data.step_name = TAX_STEP_NAMES.TAX_INFO;
|
|
76
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
76
77
|
_b = data || {}, config = _b.config, country_code = _b.country_code, entity_id = _b.entity_id, boardId = _b.id;
|
|
77
78
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
78
79
|
if (publicKey)
|
|
@@ -198,6 +199,7 @@ export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (par
|
|
|
198
199
|
})];
|
|
199
200
|
case 1:
|
|
200
201
|
data = _h.sent();
|
|
202
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
201
203
|
_b = data || {}, config = _b.config, entity_id = _b.entity_id, boardId = _b.id, country_code = _b.country_code;
|
|
202
204
|
entityData = undefined;
|
|
203
205
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
@@ -50,7 +50,7 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
|
50
50
|
import { handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
52
|
import { CONNECT_FLOWS, NAFATH_PACI_TIMEOUT_DURATION, SELECTED_POS_DEFAULT_INFO, SELECTED_TERMINAL_DEFAULT_INFO, TERMINAL_PUSH_NOTIFICATION_DURATION, TERMINAL_PUSH_NOTIFICATION_FAILED, TERMINAL_STEP_NAMES } from '../../../constants';
|
|
53
|
-
import API from '../../../api';
|
|
53
|
+
import API, { setAuthSessionToGlobalHeaders } from '../../../api';
|
|
54
54
|
import { isAuthenticationVerificationFailed, isNetworkError, isNoDataFoundError, isTimeoutError, retrieveIndividualData, sleep } from '../../../utils';
|
|
55
55
|
export var verifyToken = createAsyncThunk('terminal/verifyLeadToken', function (_a, thunkApi) {
|
|
56
56
|
var token = _a.token, isInternally = _a.isInternally;
|
|
@@ -72,6 +72,7 @@ export var verifyToken = createAsyncThunk('terminal/verifyLeadToken', function (
|
|
|
72
72
|
if (isInternally)
|
|
73
73
|
data.step_name = TERMINAL_STEP_NAMES.PHONE_AUTH;
|
|
74
74
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
75
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
75
76
|
if (publicKey)
|
|
76
77
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
77
78
|
if (country_code)
|
|
@@ -140,6 +141,7 @@ export var verifyTokenOTP = createAsyncThunk('terminal/verifyOtp', function (par
|
|
|
140
141
|
return [4, API.leadService.verifyTokenOTP(payload)];
|
|
141
142
|
case 1:
|
|
142
143
|
data = _g.sent();
|
|
144
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
143
145
|
_b = data || {}, config = _b.config, country_code = _b.country_code, merchant_id = _b.merchant_id;
|
|
144
146
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
145
147
|
countryIso2 = country_code || (authData === null || authData === void 0 ? void 0 : authData.country_code);
|