@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
package/build/@types/app.d.ts
CHANGED
package/build/api/auth.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export declare type CreateAuthBody = {
|
|
|
47
47
|
user_id?: string;
|
|
48
48
|
login?: boolean;
|
|
49
49
|
};
|
|
50
|
+
export declare type CreateAuthSessionExpiredBody = Omit<CreateAuthBody, 'user_credentail'>;
|
|
50
51
|
export declare type CreateNafathAuthBody = {
|
|
51
52
|
country: string;
|
|
52
53
|
scope: string;
|
|
@@ -140,7 +141,7 @@ declare const authService: {
|
|
|
140
141
|
getVerifyAuth: (token: string, config?: AxiosRequestConfig) => Promise<any>;
|
|
141
142
|
getTokenVerify: (token: string, config?: AxiosRequestConfig) => Promise<any>;
|
|
142
143
|
createAuthKitNID: (data: CreateAuthBody) => Promise<any>;
|
|
143
|
-
createExpressAuth: (data: CreateAuthBody, config?: AxiosRequestConfig) => Promise<any>;
|
|
144
|
+
createExpressAuth: (data: CreateAuthBody | CreateAuthSessionExpiredBody, config?: AxiosRequestConfig) => Promise<any>;
|
|
144
145
|
verifyExpressLeadIdentity: (data: VerifyAuthExpressOTPBody) => Promise<any>;
|
|
145
146
|
createExpressLeadIdentityAuth: (data: CreateAuthBody) => Promise<any>;
|
|
146
147
|
getVerifyExpressAuth: (token: string, config?: AxiosRequestConfig) => Promise<any>;
|
package/build/api/axios.js
CHANGED
|
@@ -47,7 +47,15 @@ var instance = axios.create({
|
|
|
47
47
|
instance.interceptors.request.use(function (config) {
|
|
48
48
|
return encryptionContractTransformer(config);
|
|
49
49
|
}, function (error) { return Promise.reject(error); });
|
|
50
|
-
instance.interceptors.response.use(function (response) {
|
|
50
|
+
instance.interceptors.response.use(function (response) {
|
|
51
|
+
var _a, _b, _c;
|
|
52
|
+
var errors = (_a = response.data) === null || _a === void 0 ? void 0 : _a.errors;
|
|
53
|
+
if (((_b = errors === null || errors === void 0 ? void 0 : errors[0]) === null || _b === void 0 ? void 0 : _b.code) === '7014')
|
|
54
|
+
throw new Error('session_expired');
|
|
55
|
+
if (((_c = errors === null || errors === void 0 ? void 0 : errors[0]) === null || _c === void 0 ? void 0 : _c.code) === '7013')
|
|
56
|
+
throw new Error('session_invalid');
|
|
57
|
+
return response;
|
|
58
|
+
}, function (error) {
|
|
51
59
|
return Promise.reject(error);
|
|
52
60
|
});
|
|
53
61
|
var encryptionContractTransformer = function (config) {
|
package/build/api/headers.d.ts
CHANGED
package/build/api/headers.js
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { getAxiosHeaders, setAxiosGlobalHeaders } from './axios';
|
|
1
13
|
export var getAuthHeaders = function (authSession) {
|
|
2
14
|
return authSession ? { st: authSession } : {};
|
|
3
15
|
};
|
|
16
|
+
export var setAuthSessionToGlobalHeaders = function (authSession) {
|
|
17
|
+
setAxiosGlobalHeaders(__assign(__assign({}, getAxiosHeaders()), (authSession && { st: authSession })));
|
|
18
|
+
};
|
package/build/api/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import axiosInstance, { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, getAxiosHeaders } from './axios';
|
|
2
2
|
import { ValidateOperatorBody, ConfirmBody } from './operator';
|
|
3
|
-
import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, VerifyAuthExpressOTPBody, ConfigBody, CreateNafathAuthBody, CreateKYCAuthBody } from './auth';
|
|
3
|
+
import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, VerifyAuthExpressOTPBody, ConfigBody, CreateNafathAuthBody, CreateKYCAuthBody, CreateAuthSessionExpiredBody } from './auth';
|
|
4
4
|
import { UpdateLeadBody, LeadVerifyBody, CreateLeadBody, LeadOTPVerifyBody, LeadIdentityUpdateBody, ExpressLeadVerifyBody } from './lead';
|
|
5
5
|
import { CheckEmailBody, CheckBrandBody } from './availabilityServices';
|
|
6
6
|
import { EntityInfoBody, EntityBankUpdateBody, BankDocumentInfo, UpdateEntityBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, UpdateEntityAOAFileBody, RemoveEntityActivity, MerchantListBody, CreateEntityBody } from './entity';
|
|
@@ -14,6 +14,7 @@ import { UploadFileBody } from './file';
|
|
|
14
14
|
import { DocumentUpdateBody, DocumentInfo, DocumentBody } from './document';
|
|
15
15
|
import { InitBody } from './init';
|
|
16
16
|
import { GenerateAuthLinkNewTerminalProps, UnlinkTerminalDeviceProps, LinkTerminalDeviceProps } from './terminal';
|
|
17
|
+
import { setAuthSessionToGlobalHeaders } from './headers';
|
|
17
18
|
declare const API: {
|
|
18
19
|
locationService: {
|
|
19
20
|
getIP: () => Promise<any>;
|
|
@@ -38,7 +39,7 @@ declare const API: {
|
|
|
38
39
|
getVerifyAuth: (token: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
39
40
|
getTokenVerify: (token: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
40
41
|
createAuthKitNID: (data: CreateAuthBody) => Promise<any>;
|
|
41
|
-
createExpressAuth: (data: CreateAuthBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
42
|
+
createExpressAuth: (data: CreateAuthBody | CreateAuthSessionExpiredBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
42
43
|
verifyExpressLeadIdentity: (data: VerifyAuthExpressOTPBody) => Promise<any>;
|
|
43
44
|
createExpressLeadIdentityAuth: (data: CreateAuthBody) => Promise<any>;
|
|
44
45
|
getVerifyExpressAuth: (token: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
@@ -171,6 +172,6 @@ declare const API: {
|
|
|
171
172
|
retrievePOSDevices: (merchants: string[]) => Promise<any>;
|
|
172
173
|
};
|
|
173
174
|
};
|
|
174
|
-
export type { ValidateOperatorBody, CreateAuthBody, ExpressCreateAccountBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, UpdateBoardBody, UpdateBrandBody, DataElementBody, UploadFileBody, UpdateEntityBody, DocumentUpdateBody, DocumentInfo, VerifyAuthExpressOTPBody, UpdateIndividualBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, BankDocumentInfo, GetUserListBody, GetIndividualListBody, RequestEmailBody, DocumentBody, UpdateEntityAOAFileBody, InitBody, RemoveBrandActivity, RemoveEntityActivity, UpdateIndividualWithTypeBody, UpdateMultipleIndividualBody, ExpressLeadVerifyBody, ConfirmBody, ConfigBody, MerchantListBody, CreateEntityBody, CreateNafathAuthBody, GetUserListSegmentBody, CreateKYCAuthBody, GenerateAuthLinkNewTerminalProps, UnlinkTerminalDeviceProps, LinkTerminalDeviceProps };
|
|
175
|
-
export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders };
|
|
175
|
+
export type { ValidateOperatorBody, CreateAuthBody, ExpressCreateAccountBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, UpdateBoardBody, UpdateBrandBody, DataElementBody, UploadFileBody, UpdateEntityBody, DocumentUpdateBody, DocumentInfo, VerifyAuthExpressOTPBody, UpdateIndividualBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, BankDocumentInfo, GetUserListBody, GetIndividualListBody, RequestEmailBody, DocumentBody, UpdateEntityAOAFileBody, InitBody, RemoveBrandActivity, RemoveEntityActivity, UpdateIndividualWithTypeBody, UpdateMultipleIndividualBody, ExpressLeadVerifyBody, ConfirmBody, ConfigBody, MerchantListBody, CreateEntityBody, CreateNafathAuthBody, GetUserListSegmentBody, CreateKYCAuthBody, GenerateAuthLinkNewTerminalProps, UnlinkTerminalDeviceProps, LinkTerminalDeviceProps, CreateAuthSessionExpiredBody };
|
|
176
|
+
export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders, setAuthSessionToGlobalHeaders };
|
|
176
177
|
export default API;
|
package/build/api/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import { fileService } from './file';
|
|
|
17
17
|
import { documentService } from './document';
|
|
18
18
|
import { initService } from './init';
|
|
19
19
|
import { terminalService } from './terminal';
|
|
20
|
+
import { setAuthSessionToGlobalHeaders } from './headers';
|
|
20
21
|
var API = {
|
|
21
22
|
locationService: locationService,
|
|
22
23
|
operatorService: operatorService,
|
|
@@ -37,5 +38,5 @@ var API = {
|
|
|
37
38
|
initService: initService,
|
|
38
39
|
terminalService: terminalService
|
|
39
40
|
};
|
|
40
|
-
export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders };
|
|
41
|
+
export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders, setAuthSessionToGlobalHeaders };
|
|
41
42
|
export default API;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const rootReducer: {
|
|
2
|
+
session: import("redux").Reducer<import("./session").SessionState, import("redux").AnyAction>;
|
|
2
3
|
settings: import("redux").Reducer<import("./settings").SettingsState, import("redux").AnyAction>;
|
|
3
4
|
connect: import("redux").Reducer<import("../features/app/connect/connectStore").ConnectState, import("redux").AnyAction>;
|
|
4
5
|
business: import("redux").Reducer<import("../features/app/business/businessStore").BusinessState, import("redux").AnyAction>;
|
package/build/app/rootReducer.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import session from './session';
|
|
1
2
|
import settings from './settings';
|
|
2
3
|
import connect from '../features/app/connect/connectStore';
|
|
3
4
|
import business from '../features/app/business/businessStore';
|
|
@@ -14,6 +15,7 @@ import auth from '../features/app/auth/authStore';
|
|
|
14
15
|
import kyc from '../features/app/kyc/kycStore';
|
|
15
16
|
import terminal from '../features/app/terminal/terminalStore';
|
|
16
17
|
var rootReducer = {
|
|
18
|
+
session: session,
|
|
17
19
|
settings: settings,
|
|
18
20
|
connect: connect,
|
|
19
21
|
business: business,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RootState } from './store';
|
|
2
|
+
import { ActionState, SharedState } from '../@types';
|
|
3
|
+
export interface SessionData {
|
|
4
|
+
isExpired: boolean;
|
|
5
|
+
nextScreen: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SessionState extends SharedState<SessionData> {
|
|
8
|
+
}
|
|
9
|
+
export declare const sessionSlice: import("@reduxjs/toolkit").Slice<SessionState, {
|
|
10
|
+
setSessionExpired: (state: SessionState) => void;
|
|
11
|
+
setNextScreen: (state: SessionState, action: ActionState<string>) => void;
|
|
12
|
+
resetSession: (state: SessionState) => void;
|
|
13
|
+
}, "session">;
|
|
14
|
+
export declare const setSessionExpired: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setNextScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, resetSession: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
15
|
+
declare const _default: import("redux").Reducer<SessionState, import("redux").AnyAction>;
|
|
16
|
+
export default _default;
|
|
17
|
+
export declare const sessionSelector: (state: RootState) => SessionState;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { createSlice } from '@reduxjs/toolkit';
|
|
3
|
+
var initialState = {
|
|
4
|
+
error: null,
|
|
5
|
+
loading: false,
|
|
6
|
+
data: {
|
|
7
|
+
isExpired: false,
|
|
8
|
+
nextScreen: ''
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
export var sessionSlice = createSlice({
|
|
12
|
+
name: 'session',
|
|
13
|
+
initialState: initialState,
|
|
14
|
+
reducers: {
|
|
15
|
+
setSessionExpired: function (state) {
|
|
16
|
+
state.data.isExpired = true;
|
|
17
|
+
},
|
|
18
|
+
setNextScreen: function (state, action) {
|
|
19
|
+
state.data.nextScreen = action.payload;
|
|
20
|
+
},
|
|
21
|
+
resetSession: function (state) {
|
|
22
|
+
state.data.isExpired = false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export var setSessionExpired = (_a = sessionSlice.actions, _a.setSessionExpired), setNextScreen = _a.setNextScreen, resetSession = _a.resetSession;
|
|
27
|
+
export default sessionSlice.reducer;
|
|
28
|
+
export var sessionSelector = function (state) { return state.session; };
|
package/build/app/store.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ThunkAction, Action } from '@reduxjs/toolkit';
|
|
2
2
|
export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
3
|
+
session: import("./session").SessionState;
|
|
3
4
|
settings: import("./settings").SettingsState;
|
|
4
5
|
connect: import("../features/app/connect/connectStore").ConnectState;
|
|
5
6
|
business: import("../features/app/business/businessStore").BusinessState;
|
|
@@ -16,6 +17,7 @@ export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
16
17
|
kyc: import("../features/app/kyc/kycStore").KYCDataState;
|
|
17
18
|
terminal: import("../features/app/terminal/terminalStore").TerminalDataState;
|
|
18
19
|
}, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<[import("@reduxjs/toolkit").ThunkMiddleware<{
|
|
20
|
+
session: import("./session").SessionState;
|
|
19
21
|
settings: import("./settings").SettingsState;
|
|
20
22
|
connect: import("../features/app/connect/connectStore").ConnectState;
|
|
21
23
|
business: import("../features/app/business/businessStore").BusinessState;
|
|
@@ -680,5 +680,8 @@
|
|
|
680
680
|
"year": "السنة",
|
|
681
681
|
"yes": "نعم",
|
|
682
682
|
"your_brand_details": "تفاصيل علامتك التجارية",
|
|
683
|
-
"يرجى التحقق من اسم تطبيق ابل": ""
|
|
683
|
+
"يرجى التحقق من اسم تطبيق ابل": "",
|
|
684
|
+
"session_expired_otp": "Session expired. Please verify your phone number to continue.",
|
|
685
|
+
"code_sent_to": "Code sent to ",
|
|
686
|
+
"session_invalid": "Session Invalid"
|
|
684
687
|
}
|
|
@@ -707,5 +707,8 @@
|
|
|
707
707
|
"website_label": "Website",
|
|
708
708
|
"year": "Year",
|
|
709
709
|
"yes": "Yes",
|
|
710
|
-
"your_brand_details": "Your brand details"
|
|
710
|
+
"your_brand_details": "Your brand details",
|
|
711
|
+
"session_expired_otp": "Session expired. Please verify your phone number to continue.",
|
|
712
|
+
"code_sent_to": "Code sent to ",
|
|
713
|
+
"session_invalid": "Session Invalid"
|
|
711
714
|
}
|
package/build/constants/app.d.ts
CHANGED
|
@@ -111,6 +111,8 @@ export declare const CONNECT_STEP_NAMES: {
|
|
|
111
111
|
CONNECT_MOBILE_OWNERSHIP: string;
|
|
112
112
|
CONNECT_MOBILE_OWNERSHIP_SKIPPED: string;
|
|
113
113
|
CONNECT_SUCCESS: string;
|
|
114
|
+
CREATE_AUTH_SESSION_EXPIRED: string;
|
|
115
|
+
VERIFY_AUTH_SESSION_EXPIRED: string;
|
|
114
116
|
};
|
|
115
117
|
export declare const AUTH_STEP_NAMES: {
|
|
116
118
|
CREATE_AUTH_MOBILE: string;
|
|
@@ -142,6 +144,8 @@ export declare const CONNECT_EXPRESS_STEP_NAMES: {
|
|
|
142
144
|
COLLECT_MOBILE_OWNERSHIP: string;
|
|
143
145
|
COLLECT_MOBILE_OWNERSHIP_SKIPPED: string;
|
|
144
146
|
VERIFY_AUTH_MOBILE_OTP: string;
|
|
147
|
+
CREATE_AUTH_SESSION_EXPIRED: string;
|
|
148
|
+
VERIFY_AUTH_SESSION_EXPIRED: string;
|
|
145
149
|
};
|
|
146
150
|
export declare const SignIn_STEP_NAMES: {
|
|
147
151
|
CREATE_AUTH_MOBILE: string;
|
package/build/constants/app.js
CHANGED
|
@@ -66,19 +66,22 @@ export var CONNECT_SCREENS_NAVIGATION = [
|
|
|
66
66
|
name: 'CONNECT_VERIFY_PACI_STEP',
|
|
67
67
|
next: 'CONNECT_INDIVIDUAL_STEP',
|
|
68
68
|
prev: 'CONNECT_CIVIL_ID_STEP',
|
|
69
|
-
order: 2
|
|
69
|
+
order: 2,
|
|
70
|
+
back: 'CONNECT_CIVIL_ID_STEP'
|
|
70
71
|
},
|
|
71
72
|
{
|
|
72
73
|
name: 'CONNECT_VERIFY_NAFATH_STEP',
|
|
73
74
|
next: ['CONNECT_INDIVIDUAL_STEP', 'CONNECT_DOB_STEP'],
|
|
74
75
|
prev: 'CONNECT_NID_STEP',
|
|
75
|
-
order: 2
|
|
76
|
+
order: 2,
|
|
77
|
+
back: 'CONNECT_NID_STEP'
|
|
76
78
|
},
|
|
77
79
|
{
|
|
78
80
|
name: 'CONNECT_OTP_STEP',
|
|
79
81
|
next: ['CONNECT_INDIVIDUAL_STEP', 'CONNECT_OTP_VERIFY_SECURITY_ERROR_STEP'],
|
|
80
82
|
prev: ['CONNECT_MOBILE_STEP', 'CONNECT_NID_STEP'],
|
|
81
|
-
order: 2
|
|
83
|
+
order: 2,
|
|
84
|
+
back: 'CONNECT_MOBILE_STEP'
|
|
82
85
|
},
|
|
83
86
|
{
|
|
84
87
|
name: 'CONNECT_DOB_STEP',
|
|
@@ -120,7 +123,13 @@ export var CONNECT_SCREENS_NAVIGATION = [
|
|
|
120
123
|
name: 'CONNECT_OTP_VERIFY_SECURITY_ERROR_STEP',
|
|
121
124
|
next: '',
|
|
122
125
|
prev: '',
|
|
123
|
-
order:
|
|
126
|
+
order: 7
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'CONNECT_SESSION_EXPIRED_OTP_STEP',
|
|
130
|
+
next: '',
|
|
131
|
+
prev: '',
|
|
132
|
+
order: 8
|
|
124
133
|
}
|
|
125
134
|
];
|
|
126
135
|
export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
@@ -163,7 +172,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
163
172
|
'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
|
|
164
173
|
],
|
|
165
174
|
prev: 'CONNECT_EXPRESS_NID_STEP',
|
|
166
|
-
order: 2
|
|
175
|
+
order: 2,
|
|
176
|
+
back: 'CONNECT_EXPRESS_NID_STEP'
|
|
167
177
|
},
|
|
168
178
|
{
|
|
169
179
|
name: 'CONNECT_EXPRESS_VERIFY_PACI_STEP',
|
|
@@ -173,7 +183,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
173
183
|
'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
|
|
174
184
|
],
|
|
175
185
|
prev: 'CONNECT_EXPRESS_CIVIL_ID_STEP',
|
|
176
|
-
order: 2
|
|
186
|
+
order: 2,
|
|
187
|
+
back: 'CONNECT_EXPRESS_CIVIL_ID_STEP'
|
|
177
188
|
},
|
|
178
189
|
{
|
|
179
190
|
name: 'CONNECT_EXPRESS_OTP_STEP',
|
|
@@ -186,7 +197,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
186
197
|
'CONNECT_EXPRESS_OTP_VERIFY_SECURITY_ERROR_STEP'
|
|
187
198
|
],
|
|
188
199
|
prev: 'CONNECT_EXPRESS_MOBILE_STEP',
|
|
189
|
-
order: 2
|
|
200
|
+
order: 2,
|
|
201
|
+
back: 'CONNECT_EXPRESS_MOBILE_STEP'
|
|
190
202
|
},
|
|
191
203
|
{
|
|
192
204
|
name: 'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP',
|
|
@@ -210,7 +222,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
210
222
|
name: 'CONNECT_EXPRESS_AUTH_ACCOUNT_CREATED_STEP',
|
|
211
223
|
next: 'CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP',
|
|
212
224
|
prev: 'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP',
|
|
213
|
-
order: 4
|
|
225
|
+
order: 4,
|
|
226
|
+
back: 'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
|
|
214
227
|
},
|
|
215
228
|
{
|
|
216
229
|
name: 'CONNECT_EXPRESS_AUTH_MERCHANT_LIST_STEP',
|
|
@@ -227,13 +240,15 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
227
240
|
'COLLECT_MOBILE_OWNERSHIP'
|
|
228
241
|
],
|
|
229
242
|
prev: 'CONNECT_EXPRESS_NID_MISSED_STEP',
|
|
230
|
-
order: 4
|
|
243
|
+
order: 4,
|
|
244
|
+
back: 'CONNECT_EXPRESS_NID_MISSED_STEP'
|
|
231
245
|
},
|
|
232
246
|
{
|
|
233
247
|
name: 'CONNECT_EXPRESS_VERIFY_PACI_IDENTITY_STEP',
|
|
234
248
|
next: ['CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'],
|
|
235
249
|
prev: 'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP',
|
|
236
|
-
order: 4
|
|
250
|
+
order: 4,
|
|
251
|
+
back: 'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP'
|
|
237
252
|
},
|
|
238
253
|
{
|
|
239
254
|
name: 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP',
|
|
@@ -322,6 +337,12 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
322
337
|
next: '',
|
|
323
338
|
prev: '',
|
|
324
339
|
order: 12
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
name: 'CONNECT_EXPRESS_SESSION_EXPIRED_OTP_STEP',
|
|
343
|
+
next: '',
|
|
344
|
+
prev: '',
|
|
345
|
+
order: 13
|
|
325
346
|
}
|
|
326
347
|
];
|
|
327
348
|
export var AUTH_SCREENS_NAVIGATION = [
|
|
@@ -1204,7 +1225,9 @@ export var CONNECT_STEP_NAMES = {
|
|
|
1204
1225
|
VERIFY_AUTH_PASSWORD: 'connect_verify_auth_password',
|
|
1205
1226
|
CONNECT_MOBILE_OWNERSHIP: 'collect_owner_phone',
|
|
1206
1227
|
CONNECT_MOBILE_OWNERSHIP_SKIPPED: 'collect_owner_phone_skipped',
|
|
1207
|
-
CONNECT_SUCCESS: 'connect_completed'
|
|
1228
|
+
CONNECT_SUCCESS: 'connect_completed',
|
|
1229
|
+
CREATE_AUTH_SESSION_EXPIRED: 'connect_create_auth_session_expired',
|
|
1230
|
+
VERIFY_AUTH_SESSION_EXPIRED: 'connect_verify_auth_session_expired'
|
|
1208
1231
|
};
|
|
1209
1232
|
export var AUTH_STEP_NAMES = {
|
|
1210
1233
|
CREATE_AUTH_MOBILE: 'auth_create_auth_mobile',
|
|
@@ -1235,7 +1258,9 @@ export var CONNECT_EXPRESS_STEP_NAMES = {
|
|
|
1235
1258
|
CONNECT_EXPRESS_SUCCESS: 'connect_express_completed',
|
|
1236
1259
|
COLLECT_MOBILE_OWNERSHIP: 'collect_owner_phone',
|
|
1237
1260
|
COLLECT_MOBILE_OWNERSHIP_SKIPPED: 'collect_owner_phone_skipped',
|
|
1238
|
-
VERIFY_AUTH_MOBILE_OTP: 'connect_express_auth_mobile'
|
|
1261
|
+
VERIFY_AUTH_MOBILE_OTP: 'connect_express_auth_mobile',
|
|
1262
|
+
CREATE_AUTH_SESSION_EXPIRED: 'connect_express_create_auth_session_expired',
|
|
1263
|
+
VERIFY_AUTH_SESSION_EXPIRED: 'connect_express_verify_auth_session_expired'
|
|
1239
1264
|
};
|
|
1240
1265
|
export var SignIn_STEP_NAMES = {
|
|
1241
1266
|
CREATE_AUTH_MOBILE: 'signIn_create_auth_mobile',
|
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
export declare enum KYC_FLOWS {
|
|
2
|
-
loadingData = "KYC_LOADING_DATA_STEP",
|
|
3
|
-
alreadySubmitted = "ALREADY_SUBMITTED",
|
|
4
|
-
tokenError = "TOKEN_ERROR_STEP",
|
|
5
|
-
verify = "KYC_VERIFY_STEP",
|
|
6
|
-
terms = "KYC_TERMS_STEP",
|
|
7
|
-
users = "KYC_USERS_STEP",
|
|
8
|
-
operatorError = "KYC_OPERATOR_ERROR_STEP",
|
|
9
|
-
verifyPACI = "KYC_VERIFY_PACI_STEP",
|
|
10
|
-
verifyNafath = "KYC_VERIFY_NAFATH_STEP",
|
|
11
|
-
success = "KYC_SUCCESS_STEP"
|
|
12
|
-
}
|
|
13
1
|
export declare const CONNECT_FLOWS: {
|
|
14
2
|
kyc: {
|
|
15
|
-
loadingData:
|
|
16
|
-
alreadySubmitted:
|
|
17
|
-
tokenError:
|
|
18
|
-
verify:
|
|
19
|
-
terms:
|
|
20
|
-
users:
|
|
21
|
-
operatorError:
|
|
22
|
-
verifyPACI:
|
|
23
|
-
verifyNafath:
|
|
24
|
-
success:
|
|
3
|
+
loadingData: string;
|
|
4
|
+
alreadySubmitted: string;
|
|
5
|
+
tokenError: string;
|
|
6
|
+
verify: string;
|
|
7
|
+
terms: string;
|
|
8
|
+
users: string;
|
|
9
|
+
operatorError: string;
|
|
10
|
+
verifyPACI: string;
|
|
11
|
+
verifyNafath: string;
|
|
12
|
+
success: string;
|
|
25
13
|
};
|
|
26
14
|
terminal: {
|
|
27
15
|
loadingData: string;
|
package/build/constants/flows.js
CHANGED
|
@@ -1,28 +1,15 @@
|
|
|
1
|
-
export var KYC_FLOWS;
|
|
2
|
-
(function (KYC_FLOWS) {
|
|
3
|
-
KYC_FLOWS["loadingData"] = "KYC_LOADING_DATA_STEP";
|
|
4
|
-
KYC_FLOWS["alreadySubmitted"] = "ALREADY_SUBMITTED";
|
|
5
|
-
KYC_FLOWS["tokenError"] = "TOKEN_ERROR_STEP";
|
|
6
|
-
KYC_FLOWS["verify"] = "KYC_VERIFY_STEP";
|
|
7
|
-
KYC_FLOWS["terms"] = "KYC_TERMS_STEP";
|
|
8
|
-
KYC_FLOWS["users"] = "KYC_USERS_STEP";
|
|
9
|
-
KYC_FLOWS["operatorError"] = "KYC_OPERATOR_ERROR_STEP";
|
|
10
|
-
KYC_FLOWS["verifyPACI"] = "KYC_VERIFY_PACI_STEP";
|
|
11
|
-
KYC_FLOWS["verifyNafath"] = "KYC_VERIFY_NAFATH_STEP";
|
|
12
|
-
KYC_FLOWS["success"] = "KYC_SUCCESS_STEP";
|
|
13
|
-
})(KYC_FLOWS || (KYC_FLOWS = {}));
|
|
14
1
|
export var CONNECT_FLOWS = {
|
|
15
2
|
kyc: {
|
|
16
|
-
loadingData:
|
|
17
|
-
alreadySubmitted:
|
|
18
|
-
tokenError:
|
|
19
|
-
verify:
|
|
20
|
-
terms:
|
|
21
|
-
users:
|
|
22
|
-
operatorError:
|
|
23
|
-
verifyPACI:
|
|
24
|
-
verifyNafath:
|
|
25
|
-
success:
|
|
3
|
+
loadingData: 'KYC_LOADING_DATA_STEP',
|
|
4
|
+
alreadySubmitted: 'ALREADY_SUBMITTED',
|
|
5
|
+
tokenError: 'TOKEN_ERROR_STEP',
|
|
6
|
+
verify: 'KYC_VERIFY_STEP',
|
|
7
|
+
terms: 'KYC_TERMS_STEP',
|
|
8
|
+
users: 'KYC_USERS_STEP',
|
|
9
|
+
operatorError: 'KYC_OPERATOR_ERROR_STEP',
|
|
10
|
+
verifyPACI: 'KYC_VERIFY_PACI_STEP',
|
|
11
|
+
verifyNafath: 'KYC_VERIFY_NAFATH_STEP',
|
|
12
|
+
success: 'KYC_SUCCESS_STEP'
|
|
26
13
|
},
|
|
27
14
|
terminal: {
|
|
28
15
|
loadingData: 'TERMINAL_LOADING_DATA_STEP',
|
|
@@ -69,7 +69,7 @@ var _a;
|
|
|
69
69
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
70
70
|
import { AuthForType, AuthTypeNumber, FlowsTypes, MigrationStatus } from '../../../@types';
|
|
71
71
|
import { ADD_NEW_ENTITY, AUTH_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, SCOPE_AUTH, defaultCountry } from '../../../constants';
|
|
72
|
-
import API, {
|
|
72
|
+
import API, { setAuthSessionToGlobalHeaders } from '../../../api';
|
|
73
73
|
import { handleCurrentActiveScreen, handleNextScreenStep, handleOpen, handlePrevScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
74
74
|
import { findCountryByIddPrefix, isAuthenticationVerificationFailed, isNetworkError, isTimeoutError, openConnect, sendCustomEventToGTM, sleep } from '../../../utils';
|
|
75
75
|
export var updateBusinessCountry = createAsyncThunk('auth/updateBusinessCountry', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -206,7 +206,7 @@ export var verifyMobileOtp = createAsyncThunk('auth/verifyMobileOtp', function (
|
|
|
206
206
|
})];
|
|
207
207
|
case 1:
|
|
208
208
|
data = _g.sent();
|
|
209
|
-
|
|
209
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
210
210
|
sendCustomEventToGTM({
|
|
211
211
|
event: 'Send Event',
|
|
212
212
|
event_category: 'User Registration Flow',
|
|
@@ -252,7 +252,7 @@ export var verifyPasscode = createAsyncThunk('auth/verifyPasscode', function (pa
|
|
|
252
252
|
})];
|
|
253
253
|
case 1:
|
|
254
254
|
data = _j.sent();
|
|
255
|
-
|
|
255
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
256
256
|
if (((_e = data === null || data === void 0 ? void 0 : data.status) === null || _e === void 0 ? void 0 : _e.toLowerCase()) === 'success' && (data === null || data === void 0 ? void 0 : data.auth_session)) {
|
|
257
257
|
if (scope === 'merchant') {
|
|
258
258
|
openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
|
|
@@ -328,7 +328,7 @@ export var verifyEmailPassword = createAsyncThunk('auth/verifyEmailPassword', fu
|
|
|
328
328
|
return [4, API.authService.verifyAuth(payload)];
|
|
329
329
|
case 1:
|
|
330
330
|
data = _g.sent();
|
|
331
|
-
|
|
331
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
332
332
|
if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.MOBILE_OTP) {
|
|
333
333
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('AUTH_OTP_STEP')); });
|
|
334
334
|
return [2, data];
|
|
@@ -397,7 +397,7 @@ export var verifyEmailOtp = createAsyncThunk('auth/verifyEmailOtp', function (pa
|
|
|
397
397
|
})];
|
|
398
398
|
case 1:
|
|
399
399
|
data = _g.sent();
|
|
400
|
-
|
|
400
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
401
401
|
sendCustomEventToGTM({
|
|
402
402
|
event: 'Send Event',
|
|
403
403
|
event_category: 'User Registration Flow',
|
|
@@ -489,7 +489,7 @@ export var verifyNafath = createAsyncThunk('auth/verifyNafath', function (params
|
|
|
489
489
|
return [2, { value: data }];
|
|
490
490
|
}
|
|
491
491
|
if (isSuccess) {
|
|
492
|
-
|
|
492
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
493
493
|
if (scope === 'merchant') {
|
|
494
494
|
openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
|
|
495
495
|
return [2, { value: data }];
|
|
@@ -615,7 +615,7 @@ export var verifyPACI = createAsyncThunk('auth/verifyPACI', function (params, th
|
|
|
615
615
|
case 5:
|
|
616
616
|
isSuccess = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
617
617
|
if (isSuccess) {
|
|
618
|
-
|
|
618
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
619
619
|
if (scope === 'merchant') {
|
|
620
620
|
openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
|
|
621
621
|
return [2, data];
|
|
@@ -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 { handleCurrentActiveScreen, handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
53
53
|
import { BANK_STEP_NAMES } from '../../../constants';
|
|
@@ -70,6 +70,7 @@ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (_
|
|
|
70
70
|
data = (_j.sent()).data;
|
|
71
71
|
if ((_c = data.errors) === null || _c === void 0 ? void 0 : _c.length)
|
|
72
72
|
throw new Error(data.errors[0].description);
|
|
73
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
73
74
|
bankData = undefined;
|
|
74
75
|
_b = data || {}, config = _b.config, country_code = _b.country_code, step_name = _b.step_name, bank_account_id = _b.bank_account_id, wallet_id = _b.wallet_id, boardId = _b.id;
|
|
75
76
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
@@ -155,6 +156,7 @@ export var verifyBankLeadOTP = createAsyncThunk('verifyBankLeadOTP', function (p
|
|
|
155
156
|
})];
|
|
156
157
|
case 1:
|
|
157
158
|
data = _m.sent();
|
|
159
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
158
160
|
countryIso2 = (data === null || data === void 0 ? void 0 : data.country_code) || (responseBody === null || responseBody === void 0 ? void 0 : responseBody.country_code);
|
|
159
161
|
publicKey = (_d = data === null || data === void 0 ? void 0 : data.config) === null || _d === void 0 ? void 0 : _d.public_key;
|
|
160
162
|
if (countryIso2)
|
|
@@ -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, handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
|
|
53
53
|
import { BOARD_STEP_STEPS } from '../../../constants';
|
|
@@ -72,6 +72,7 @@ export var createVerifyTokenBy = createAsyncThunk('board/createVerifyTokenByBoar
|
|
|
72
72
|
data = _f.sent();
|
|
73
73
|
_b = data || {}, country_code = _b.country_code, config = _b.config;
|
|
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 (country_code)
|
|
76
77
|
thunkApi.dispatch(handleSetCountryByIso2(country_code));
|
|
77
78
|
if (publicKey)
|
|
@@ -136,6 +137,7 @@ export var verifyBoardLeadOTP = createAsyncThunk('board/verifyBoardLeadOTP', fun
|
|
|
136
137
|
})];
|
|
137
138
|
case 1:
|
|
138
139
|
data = _j.sent();
|
|
140
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
139
141
|
_b = data || {}, country_code = _b.country_code, config = _b.config;
|
|
140
142
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
141
143
|
if (country_code)
|
|
@@ -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 { FlowsTypes } from '../../../@types';
|
|
63
63
|
import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
64
64
|
import { BRAND_STEP_NAMES, EXPECTED_SALES_LIST } from '../../../constants';
|
|
@@ -83,6 +83,7 @@ export var verifyLeadToken = createAsyncThunk('brand/verifyLeadToken', function
|
|
|
83
83
|
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
84
84
|
_b = data || {}, config = _b.config, brand_id = _b.brand_id, entity_id = _b.entity_id, board_id = _b.id, country_code = _b.country_code;
|
|
85
85
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
86
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
86
87
|
if (country_code)
|
|
87
88
|
thunkApi.dispatch(handleSetCountryByIso2(country_code));
|
|
88
89
|
if (publicKey)
|
|
@@ -163,6 +164,7 @@ export var verifyBrandLeadOTP = createAsyncThunk('brand/verifyLeadOTP', function
|
|
|
163
164
|
})];
|
|
164
165
|
case 1:
|
|
165
166
|
data = _j.sent();
|
|
167
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
166
168
|
publicKey = (_d = data === null || data === void 0 ? void 0 : data.config) === null || _d === void 0 ? void 0 : _d.public_key;
|
|
167
169
|
countryIso2 = (data === null || data === void 0 ? void 0 : data.country_code) || (responseBody === null || responseBody === void 0 ? void 0 : responseBody.country_code);
|
|
168
170
|
if (publicKey)
|
|
@@ -56,7 +56,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
56
56
|
};
|
|
57
57
|
var _a;
|
|
58
58
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
59
|
-
import API from '../../../api';
|
|
59
|
+
import API, { setAuthSessionToGlobalHeaders } from '../../../api';
|
|
60
60
|
import { BusinessType, FlowsTypes, DocumentPurpose, LicenseType } from '../../../@types';
|
|
61
61
|
import { BUSINESS_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, EXPECTED_SALES_LIST, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_ENTITY_LICENSE, OTHER_FL_LICENSE, defaultCountry } from '../../../constants';
|
|
62
62
|
import { convertNumbers2English, hasKey, sleep, isKW, isSA, dateFormat, isOtherLicense, isOtherThanKWOrSA, hasNoneEditableValue, sendCustomEventToGTM, findCountryByIddPrefix, isNetworkError, isTimeoutError, isAuthenticationVerificationFailed } from '../../../utils';
|
|
@@ -78,6 +78,7 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
|
|
|
78
78
|
throw new Error(data.errors[0].description);
|
|
79
79
|
if (data.mw_error)
|
|
80
80
|
throw new Error(data.mw_error);
|
|
81
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
81
82
|
publicKey = (_c = data === null || data === void 0 ? void 0 : data.config) === null || _c === void 0 ? void 0 : _c.public_key;
|
|
82
83
|
if (publicKey) {
|
|
83
84
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
@@ -220,6 +221,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
|
|
|
220
221
|
})];
|
|
221
222
|
case 1:
|
|
222
223
|
data = _j.sent();
|
|
224
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
223
225
|
publicKey = (_f = data === null || data === void 0 ? void 0 : data.config) === null || _f === void 0 ? void 0 : _f.public_key;
|
|
224
226
|
if (publicKey) {
|
|
225
227
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
@@ -25,6 +25,12 @@ export declare const verifyAuth: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
25
25
|
leadResponse: any;
|
|
26
26
|
countryCode: CountryCode;
|
|
27
27
|
}, OTPFormValues, {}>;
|
|
28
|
+
export declare const createAuthSessionExpired: import("@reduxjs/toolkit").AsyncThunk<{
|
|
29
|
+
response: any;
|
|
30
|
+
}, boolean, {}>;
|
|
31
|
+
export declare const verifySessionExpiredOtp: import("@reduxjs/toolkit").AsyncThunk<{
|
|
32
|
+
data: any;
|
|
33
|
+
}, OTPFormValues, {}>;
|
|
28
34
|
interface verifyPACIParams {
|
|
29
35
|
onSuccess?: () => void;
|
|
30
36
|
}
|