@frontegg/redux-store 5.9.1 → 5.13.0
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/auth/ApiTokensState/interfaces.d.ts +2 -1
- package/auth/LoginState/index.d.ts +3 -0
- package/auth/LoginState/saga.d.ts +4 -17
- package/auth/SignUp/saga.d.ts +6 -1
- package/auth/index.d.ts +2 -0
- package/auth/index.js +211 -211
- package/auth/reducer.d.ts +2 -0
- package/connectivity/index.js +2 -1
- package/node/auth/index.js +210 -210
- package/node/connectivity/index.js +2 -1
- package/node/subscriptions/index.js +54 -42
- package/package.json +2 -2
- package/subscriptions/Billing/Information/interfaces.d.ts +1 -0
- package/subscriptions/Billing/Invoices/index.d.ts +0 -2
- package/subscriptions/Billing/Invoices/interfaces.d.ts +1 -0
- package/subscriptions/Billing/PaymentMethod/interfaces.d.ts +1 -0
- package/subscriptions/Billing/index.d.ts +0 -1
- package/subscriptions/Config/interfaces.d.ts +1 -0
- package/subscriptions/Plans/index.d.ts +0 -2
- package/subscriptions/Plans/interfaces.d.ts +1 -0
- package/subscriptions/index.d.ts +0 -2
- package/subscriptions/index.js +54 -42
- package/subscriptions/reducer.d.ts +0 -2
- package/subscriptions/utils.d.ts +2 -0
|
@@ -26,8 +26,9 @@ export declare type createdByUserIdColumn = 'show' | 'hide' | undefined;
|
|
|
26
26
|
export interface IApiTokensData {
|
|
27
27
|
clientId: string;
|
|
28
28
|
createdAt: string;
|
|
29
|
-
secret
|
|
29
|
+
secret?: string;
|
|
30
30
|
description: string;
|
|
31
|
+
metadata?: {};
|
|
31
32
|
}
|
|
32
33
|
export declare type IUserApiTokensData = IApiTokensData;
|
|
33
34
|
export interface ITenantApiTokensData extends IApiTokensData {
|
|
@@ -76,8 +76,10 @@ declare const actions: {
|
|
|
76
76
|
afterAuthNavigation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
77
77
|
preLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IPreLogin & {
|
|
78
78
|
recaptchaToken?: string | undefined;
|
|
79
|
+
invitationToken?: string | undefined;
|
|
79
80
|
}, void>], WithCallback<IPreLogin & {
|
|
80
81
|
recaptchaToken?: string | undefined;
|
|
82
|
+
invitationToken?: string | undefined;
|
|
81
83
|
}, void>, string, never, never>;
|
|
82
84
|
postLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[IPostLogin], IPostLogin, string, never, never>;
|
|
83
85
|
login: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[ILogin], ILogin, string, never, never>;
|
|
@@ -107,6 +109,7 @@ declare type DispatchedActions = {
|
|
|
107
109
|
afterAuthNavigation: () => void;
|
|
108
110
|
preLogin: (payload: WithCallback<IPreLogin & {
|
|
109
111
|
recaptchaToken?: string;
|
|
112
|
+
invitationToken?: string;
|
|
110
113
|
}, void>) => void;
|
|
111
114
|
postLogin: (payload: IPostLogin) => void;
|
|
112
115
|
login: (payload: ILogin) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CallEffect } from 'redux-saga/effects';
|
|
2
|
-
import { IAllowedToRememberMfaDevice, ILoginResponse, ISamlMetadata } from '@frontegg/rest-api';
|
|
2
|
+
import { IAllowedToRememberMfaDevice, ILoginResponse, ILoginResponseV2, ISamlMetadata } from '@frontegg/rest-api';
|
|
3
3
|
import { AuthState } from '../interfaces';
|
|
4
4
|
import { LoginStep } from './interfaces';
|
|
5
5
|
export declare function afterAuthNavigation(): Generator<import("redux-saga/effects").SelectEffect | CallEffect<true>, void, {
|
|
@@ -70,22 +70,9 @@ export declare function refreshToken(): Generator<import("redux-saga/effects").S
|
|
|
70
70
|
}, AuthState & {
|
|
71
71
|
isAllowedToRemember: any;
|
|
72
72
|
mfaDeviceExpiration: any;
|
|
73
|
-
}> | CallEffect<
|
|
74
|
-
payload:
|
|
75
|
-
callback?: ((data: import("@frontegg/rest-api").ITenantsResponse[] | null, error?: string | undefined) => void) | undefined;
|
|
76
|
-
} | undefined;
|
|
73
|
+
}> | CallEffect<ILoginResponseV2> | import("redux-saga/effects").PutEffect<{
|
|
74
|
+
payload: Partial<import("../..").TenantsState>;
|
|
77
75
|
type: string;
|
|
78
|
-
}>, void, AuthState &
|
|
79
|
-
mfaRequired: boolean;
|
|
80
|
-
accessToken: string;
|
|
81
|
-
refreshToken: string;
|
|
82
|
-
expires: string;
|
|
83
|
-
expiresIn: number;
|
|
84
|
-
mfaToken?: string | undefined;
|
|
85
|
-
qrCode?: string | undefined;
|
|
86
|
-
recoveryCode?: string | undefined;
|
|
87
|
-
emailVerified?: boolean | undefined;
|
|
88
|
-
redirectLocation?: string | undefined;
|
|
89
|
-
} & Partial<AuthState>>;
|
|
76
|
+
}>, void, AuthState & ILoginResponseV2 & Partial<AuthState>>;
|
|
90
77
|
export declare function loginSagas(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
|
91
78
|
export declare function loginSagasMock(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
package/auth/SignUp/saga.d.ts
CHANGED
|
@@ -3,7 +3,12 @@ import { ISignUpUser, IVendorConfig } from '@frontegg/rest-api';
|
|
|
3
3
|
export declare function loadAllowSignUps(): Generator<import("redux-saga/effects").PutEffect<{
|
|
4
4
|
payload: Partial<import("./interfaces").SignUpState>;
|
|
5
5
|
type: string;
|
|
6
|
-
}> | import("redux-saga/effects").CallEffect<IVendorConfig
|
|
6
|
+
}> | import("redux-saga/effects").CallEffect<IVendorConfig> | import("redux-saga/effects").PutEffect<{
|
|
7
|
+
payload: Partial<import("../../interfaces").WithStatus & {
|
|
8
|
+
policy?: IVendorConfig | undefined;
|
|
9
|
+
}>;
|
|
10
|
+
type: string;
|
|
11
|
+
}>, void, IVendorConfig>;
|
|
7
12
|
export declare function signUpUser({ payload }: PayloadAction<ISignUpUser>): Generator<import("redux-saga/effects").PutEffect<{
|
|
8
13
|
payload: Partial<import("./interfaces").SignUpState>;
|
|
9
14
|
type: string;
|
package/auth/index.d.ts
CHANGED
|
@@ -235,8 +235,10 @@ declare const _default: {
|
|
|
235
235
|
afterAuthNavigation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
236
236
|
preLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IPreLogin & {
|
|
237
237
|
recaptchaToken?: string | undefined;
|
|
238
|
+
invitationToken?: string | undefined;
|
|
238
239
|
}, void>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IPreLogin & {
|
|
239
240
|
recaptchaToken?: string | undefined;
|
|
241
|
+
invitationToken?: string | undefined;
|
|
240
242
|
}, void>, string, never, never>;
|
|
241
243
|
postLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IPostLogin], import("@frontegg/rest-api").IPostLogin, string, never, never>;
|
|
242
244
|
login: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").ILogin], import("@frontegg/rest-api").ILogin, string, never, never>;
|
package/auth/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createAction, createSlice } from '@reduxjs/toolkit';
|
|
|
2
2
|
import { a as authStoreName, F as FRONTEGG_AFTER_AUTH_REDIRECT_URL, H as HOSTED_LOGIN_VERIFIER_KEY } from '../constants-4d9682b2.js';
|
|
3
3
|
export { a as authStoreName } from '../constants-4d9682b2.js';
|
|
4
4
|
import { __awaiter, __rest } from 'tslib';
|
|
5
|
-
import { takeLeading, put, select, call,
|
|
5
|
+
import { takeLeading, put, select, call, delay as delay$1, all, takeEvery, retry, takeLatest } from 'redux-saga/effects';
|
|
6
6
|
import { AuthStrategyEnum, api, ContextHolder, fetch } from '@frontegg/rest-api';
|
|
7
7
|
export { AuthStrategyEnum } from '@frontegg/rest-api';
|
|
8
8
|
import { l as loadVendorPublicInfo } from '../saga-b6529ffb.js';
|
|
@@ -768,8 +768,10 @@ const tenantsDemo = [
|
|
|
768
768
|
function* loadAllowSignUps() {
|
|
769
769
|
yield put(actions.setSignUpState({ loading: true }));
|
|
770
770
|
try {
|
|
771
|
-
const
|
|
771
|
+
const policy = yield call(api.auth.getVendorConfig);
|
|
772
|
+
const { allowSignups: allowSignUps, allowNotVerifiedUsersLogin } = policy;
|
|
772
773
|
yield put(actions.setSignUpState({ loading: false, allowSignUps, allowNotVerifiedUsersLogin, firstLoad: false }));
|
|
774
|
+
yield put(actions.setSecurityPolicyPublicState({ policy, loading: false }));
|
|
773
775
|
}
|
|
774
776
|
catch (e) {
|
|
775
777
|
yield put(actions.setSignUpState({ loading: false, error: e.message, firstLoad: false }));
|
|
@@ -825,207 +827,6 @@ function* signUpSaga() {
|
|
|
825
827
|
yield takeLeading(actions.resetSignUpStateSoft, resetSignUpStateSoft);
|
|
826
828
|
}
|
|
827
829
|
|
|
828
|
-
function* loadSecurityPolicy() {
|
|
829
|
-
yield put(actions.setSecurityPolicyGlobalState({ loading: true, error: null }));
|
|
830
|
-
try {
|
|
831
|
-
const policy = yield call(api.auth.getGlobalSecurityPolicy);
|
|
832
|
-
yield put(actions.setSecurityPolicyGlobalState({ policy, loading: false }));
|
|
833
|
-
}
|
|
834
|
-
catch (e) {
|
|
835
|
-
yield put(actions.setSecurityPolicyGlobalState({ error: e.message, loading: false }));
|
|
836
|
-
}
|
|
837
|
-
yield put(actions.loadSecurityPolicyMfa());
|
|
838
|
-
yield put(actions.loadSecurityPolicyLockout());
|
|
839
|
-
yield put(actions.loadSecurityPolicyCaptcha());
|
|
840
|
-
}
|
|
841
|
-
function* loadPublicSecurityPolicy() {
|
|
842
|
-
yield put(actions.setSecurityPolicyPublicState({ loading: true, error: null }));
|
|
843
|
-
try {
|
|
844
|
-
const policy = yield call(api.auth.getVendorConfig);
|
|
845
|
-
yield put(actions.setSecurityPolicyPublicState({ policy, loading: false }));
|
|
846
|
-
}
|
|
847
|
-
catch (e) {
|
|
848
|
-
yield put(actions.setSecurityPolicyPublicState({ error: e.message, loading: false }));
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
function* loadSecurityPolicyMfa() {
|
|
852
|
-
yield put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
853
|
-
try {
|
|
854
|
-
const policy = yield call(api.auth.getMfaPolicy);
|
|
855
|
-
yield put(actions.setSecurityPolicyMfaState({ policy, loading: false }));
|
|
856
|
-
}
|
|
857
|
-
catch (e) {
|
|
858
|
-
yield put(actions.setSecurityPolicyMfaState({ error: e.message, loading: false }));
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
function* saveSecurityPolicyMfa(_a) {
|
|
862
|
-
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
863
|
-
yield put(actions.setSecurityPolicyMfaState({ saving: true, error: null }));
|
|
864
|
-
try {
|
|
865
|
-
const policy = yield call(api.auth.saveMfaPolicy, newSecurityPolicy);
|
|
866
|
-
yield put(actions.setSecurityPolicyMfaState({ policy, saving: false }));
|
|
867
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
868
|
-
}
|
|
869
|
-
catch (e) {
|
|
870
|
-
yield put(actions.setSecurityPolicyMfaState({ saving: false, error: e.message }));
|
|
871
|
-
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
function* loadSecurityPolicyLockout() {
|
|
875
|
-
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
876
|
-
try {
|
|
877
|
-
const policy = yield call(api.auth.getLockoutPolicy);
|
|
878
|
-
yield put(actions.setSecurityPolicyLockoutState({ policy, loading: false }));
|
|
879
|
-
}
|
|
880
|
-
catch (e) {
|
|
881
|
-
yield put(actions.setSecurityPolicyLockoutState({ error: e.message, loading: false }));
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
function* saveSecurityPolicyLockout(_a) {
|
|
885
|
-
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
886
|
-
yield put(actions.setSecurityPolicyLockoutState({ saving: true, error: null }));
|
|
887
|
-
try {
|
|
888
|
-
const policy = yield call(api.auth.saveLockoutPolicy, newSecurityPolicy);
|
|
889
|
-
yield put(actions.setSecurityPolicyLockoutState({ policy, saving: false }));
|
|
890
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
891
|
-
}
|
|
892
|
-
catch (e) {
|
|
893
|
-
yield put(actions.setSecurityPolicyLockoutState({ saving: false, error: e.message }));
|
|
894
|
-
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
function* loadSecurityPolicyCaptcha() {
|
|
898
|
-
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
899
|
-
try {
|
|
900
|
-
const policy = yield call(api.auth.getCaptchaPolicy);
|
|
901
|
-
yield put(actions.setSecurityPolicyCaptchaState({ policy, loading: false }));
|
|
902
|
-
}
|
|
903
|
-
catch (e) {
|
|
904
|
-
yield put(actions.setSecurityPolicyCaptchaState({ error: e.message, loading: false }));
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
function* loadSecurityPolicyPasswordHistory() {
|
|
908
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ loading: true, error: null }));
|
|
909
|
-
try {
|
|
910
|
-
const policy = yield call(api.auth.getPasswordHistoryPolicy);
|
|
911
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy, loading: false }));
|
|
912
|
-
}
|
|
913
|
-
catch (e) {
|
|
914
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ error: e.message, loading: false }));
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
function* saveSecurityPolicyPasswordHistory(_a) {
|
|
918
|
-
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
919
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ saving: true, error: null }));
|
|
920
|
-
try {
|
|
921
|
-
const policy = yield call(api.auth.savePasswordHistoryPolicy, newSecurityPolicy);
|
|
922
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy, saving: false }));
|
|
923
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
924
|
-
}
|
|
925
|
-
catch (e) {
|
|
926
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ saving: false, error: e.message }));
|
|
927
|
-
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
function* loadVendorPasswordConfig() {
|
|
931
|
-
yield put(actions.setSecurityPolicyPasswordState({ loading: true, error: null }));
|
|
932
|
-
try {
|
|
933
|
-
const policy = yield call(api.auth.getPasswordConfigPolicy);
|
|
934
|
-
yield put(actions.setSecurityPolicyPasswordState({ policy, loading: false }));
|
|
935
|
-
}
|
|
936
|
-
catch (e) {
|
|
937
|
-
yield put(actions.setSecurityPolicyPasswordState({ error: e.message, loading: false }));
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
function* securityPolicySagas() {
|
|
941
|
-
yield takeLeading(actions.loadSecurityPolicy, loadSecurityPolicy);
|
|
942
|
-
yield takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfa);
|
|
943
|
-
yield takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfa);
|
|
944
|
-
yield takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockout);
|
|
945
|
-
yield takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockout);
|
|
946
|
-
yield takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptcha);
|
|
947
|
-
yield takeEvery(actions.saveSecurityPolicyPasswordHistory, saveSecurityPolicyPasswordHistory);
|
|
948
|
-
yield takeEvery(actions.loadSecurityPolicyPasswordHistory, loadSecurityPolicyPasswordHistory);
|
|
949
|
-
yield takeEvery(actions.loadVendorPasswordConfig, loadVendorPasswordConfig);
|
|
950
|
-
yield takeEvery(actions.loadPublicSecurityPolicy, loadPublicSecurityPolicy);
|
|
951
|
-
}
|
|
952
|
-
/*********************************
|
|
953
|
-
* Preview Sagas
|
|
954
|
-
*********************************/
|
|
955
|
-
function* loadPublicSecurityPolicyMock() {
|
|
956
|
-
yield put(actions.setSecurityPolicyPublicState({ loading: true, error: null }));
|
|
957
|
-
try {
|
|
958
|
-
yield put(actions.setSecurityPolicyPublicState({ policy: publicSecurityPolicy, loading: false }));
|
|
959
|
-
}
|
|
960
|
-
catch (e) {
|
|
961
|
-
yield put(actions.setSecurityPolicyPublicState({ error: e.message, loading: false }));
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
function* loadSecurityPolicyMock() {
|
|
965
|
-
yield put(actions.setSecurityPolicyGlobalState({ loading: true, error: null }));
|
|
966
|
-
yield delay();
|
|
967
|
-
yield put(actions.setSecurityPolicyGlobalState({ policy: policyDemo, loading: false }));
|
|
968
|
-
yield put(actions.loadSecurityPolicyMfa());
|
|
969
|
-
yield put(actions.loadSecurityPolicyLockout());
|
|
970
|
-
yield put(actions.loadSecurityPolicyCaptcha());
|
|
971
|
-
}
|
|
972
|
-
function* loadSecurityPolicyMfaMock() {
|
|
973
|
-
yield put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
974
|
-
yield delay();
|
|
975
|
-
yield put(actions.setSecurityPolicyMfaState({ policy: policyMfaDemo, loading: false }));
|
|
976
|
-
}
|
|
977
|
-
function* saveSecurityPolicyMfaMock(_a) {
|
|
978
|
-
var _b;
|
|
979
|
-
var _c = _a.payload, { callback } = _c, newSecurityPolicy = __rest(_c, ["callback"]);
|
|
980
|
-
yield put(actions.setSecurityPolicyMfaState({ saving: true, error: null }));
|
|
981
|
-
const policy = Object.assign(Object.assign({}, policyLockoutDemo), { id: (_b = newSecurityPolicy.id) !== null && _b !== void 0 ? _b : policyLockoutDemo.id, enforceMFAType: newSecurityPolicy.enforceMFAType });
|
|
982
|
-
yield delay();
|
|
983
|
-
yield put(actions.setSecurityPolicyMfaState({ policy, saving: false }));
|
|
984
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
985
|
-
}
|
|
986
|
-
function* loadSecurityPolicyLockoutMock() {
|
|
987
|
-
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
988
|
-
yield delay();
|
|
989
|
-
yield put(actions.setSecurityPolicyLockoutState({ policy: policyLockoutDemo, loading: false }));
|
|
990
|
-
}
|
|
991
|
-
function* saveSecurityPolicyLockoutMock(_a) {
|
|
992
|
-
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
993
|
-
yield put(actions.setSecurityPolicyLockoutState({ saving: true, error: null }));
|
|
994
|
-
yield delay();
|
|
995
|
-
const policy = Object.assign(Object.assign(Object.assign({}, newSecurityPolicy), policyLockoutDemo), { id: newSecurityPolicy.id ? newSecurityPolicy.id : policyLockoutDemo.id });
|
|
996
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
997
|
-
yield put(actions.setSecurityPolicyLockoutState({ policy, saving: false }));
|
|
998
|
-
}
|
|
999
|
-
function* loadSecurityPolicyCaptchaMock() {
|
|
1000
|
-
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
1001
|
-
yield delay();
|
|
1002
|
-
yield put(actions.setSecurityPolicyLockoutState({ policy: policyLockoutDemo, loading: false }));
|
|
1003
|
-
}
|
|
1004
|
-
function* loadSecurityPolicyPasswordHistoryMock() {
|
|
1005
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ loading: true, error: null }));
|
|
1006
|
-
yield delay();
|
|
1007
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy: policyPasswordHistoryDemo, loading: false }));
|
|
1008
|
-
}
|
|
1009
|
-
function* saveSecurityPolicyPasswordHistoryMock(_a) {
|
|
1010
|
-
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
1011
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ saving: true, error: null }));
|
|
1012
|
-
yield delay();
|
|
1013
|
-
const policy = Object.assign(Object.assign(Object.assign({}, newSecurityPolicy), policyPasswordHistoryDemo), { id: newSecurityPolicy.id ? newSecurityPolicy.id : policyPasswordHistoryDemo.id });
|
|
1014
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
1015
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy, saving: false }));
|
|
1016
|
-
}
|
|
1017
|
-
function* securityPolicySagasMock() {
|
|
1018
|
-
yield takeLeading(actions.loadSecurityPolicy, loadSecurityPolicyMock);
|
|
1019
|
-
yield takeEvery(actions.loadPublicSecurityPolicy, loadPublicSecurityPolicyMock);
|
|
1020
|
-
yield takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfaMock);
|
|
1021
|
-
yield takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfaMock);
|
|
1022
|
-
yield takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockoutMock);
|
|
1023
|
-
yield takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockoutMock);
|
|
1024
|
-
yield takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptchaMock);
|
|
1025
|
-
yield takeEvery(actions.saveSecurityPolicyPasswordHistory, saveSecurityPolicyPasswordHistoryMock);
|
|
1026
|
-
yield takeEvery(actions.loadSecurityPolicyPasswordHistory, loadSecurityPolicyPasswordHistoryMock);
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
830
|
function* afterAuthNavigation() {
|
|
1030
831
|
var _a;
|
|
1031
832
|
const onRedirectTo = ContextHolder.onRedirectTo;
|
|
@@ -1105,14 +906,14 @@ function* refreshToken() {
|
|
|
1105
906
|
try {
|
|
1106
907
|
const onRedirectTo = ContextHolder.onRedirectTo;
|
|
1107
908
|
const { routes, loginState } = yield select((state) => state.auth);
|
|
1108
|
-
const user = yield call(api.auth.
|
|
909
|
+
const { user, tenants } = yield call(api.auth.refreshTokenV2);
|
|
1109
910
|
if (isMfaRequired(user)) {
|
|
1110
911
|
const mfaRequiredState = yield getMfaRequiredState(user);
|
|
1111
912
|
yield put(actions.setState(mfaRequiredState));
|
|
1112
913
|
onRedirectTo(routes.loginUrl, { preserveQueryParams: true });
|
|
1113
914
|
}
|
|
1114
915
|
else {
|
|
1115
|
-
yield put(actions.
|
|
916
|
+
yield put(actions.setTenantsState({ tenants, loading: false }));
|
|
1116
917
|
yield put(actions.setState({ user, isAuthenticated: true }));
|
|
1117
918
|
if ([routes.loginUrl, routes.socialLoginCallbackUrl, routes.signUpUrl, routes.oidcRedirectUrl].some(url => url && window.location.pathname.endsWith(url)) ||
|
|
1118
919
|
(window.location.pathname.endsWith(routes.activateUrl) && user.verified)) {
|
|
@@ -1135,12 +936,11 @@ function* requestAuthorize({ payload: firstTime }) {
|
|
|
1135
936
|
const calls = [];
|
|
1136
937
|
if (firstTime) {
|
|
1137
938
|
yield put(actions.setState({ isLoading: true }));
|
|
1138
|
-
calls.push(call(refreshMetadata));
|
|
1139
939
|
yield put(actions.loadSocialLoginsConfigurationV2());
|
|
1140
940
|
calls.push(call(loadAllowSignUps));
|
|
1141
941
|
calls.push(call(loadSSOPublicConfigurationFunction));
|
|
1142
942
|
calls.push(call(loadVendorPublicInfo));
|
|
1143
|
-
calls.push(call(
|
|
943
|
+
calls.push(call(refreshMetadata));
|
|
1144
944
|
}
|
|
1145
945
|
calls.push(call(refreshToken));
|
|
1146
946
|
yield all(calls);
|
|
@@ -1242,7 +1042,7 @@ function* verifyInviteToken({ payload }) {
|
|
|
1242
1042
|
yield put(actions.setLoginState({ loading: false }));
|
|
1243
1043
|
}
|
|
1244
1044
|
}
|
|
1245
|
-
function* preLogin({ payload: { email, recaptchaToken, callback } }) {
|
|
1045
|
+
function* preLogin({ payload: { email, recaptchaToken, invitationToken, callback } }) {
|
|
1246
1046
|
yield put(actions.setLoginState({ loading: true }));
|
|
1247
1047
|
try {
|
|
1248
1048
|
const onRedirectTo = yield select(({ auth: { onRedirectTo } }) => onRedirectTo);
|
|
@@ -1258,11 +1058,11 @@ function* preLogin({ payload: { email, recaptchaToken, callback } }) {
|
|
|
1258
1058
|
}, 2000);
|
|
1259
1059
|
}
|
|
1260
1060
|
else {
|
|
1261
|
-
yield ssoPreloginFailed({ email, recaptchaToken, callback });
|
|
1061
|
+
yield ssoPreloginFailed({ email, recaptchaToken, callback, invitationToken });
|
|
1262
1062
|
}
|
|
1263
1063
|
}
|
|
1264
1064
|
catch (e) {
|
|
1265
|
-
yield ssoPreloginFailed({ email, recaptchaToken, callback });
|
|
1065
|
+
yield ssoPreloginFailed({ email, recaptchaToken, callback, invitationToken });
|
|
1266
1066
|
}
|
|
1267
1067
|
}
|
|
1268
1068
|
function* ssoPreloginFailed(_a) {
|
|
@@ -2796,7 +2596,6 @@ function* loadSocialLoginsConfigurations() {
|
|
|
2796
2596
|
function* loadSocialLoginsConfigurationsV2() {
|
|
2797
2597
|
try {
|
|
2798
2598
|
yield put(actions.setSocialLoginsState({ loading: true }));
|
|
2799
|
-
console.log('api.auth.getSocialLoginProvidersV2', api.auth.getSocialLoginProvidersV2);
|
|
2800
2599
|
const socialLoginsConfigV2 = yield call(api.auth.getSocialLoginProvidersV2);
|
|
2801
2600
|
const baseUrl = fetch.getBaseUrl(ContextHolder.getContext());
|
|
2802
2601
|
const socialLoginsConfigWithFullUrl = socialLoginsConfigV2.map((_a) => {
|
|
@@ -3039,6 +2838,207 @@ function* apiTokensSagaMock() {
|
|
|
3039
2838
|
yield takeLatest(actions.deleteTenantApiToken, deleteTenantApiTokenMock);
|
|
3040
2839
|
}
|
|
3041
2840
|
|
|
2841
|
+
function* loadSecurityPolicy() {
|
|
2842
|
+
yield put(actions.setSecurityPolicyGlobalState({ loading: true, error: null }));
|
|
2843
|
+
try {
|
|
2844
|
+
const policy = yield call(api.auth.getGlobalSecurityPolicy);
|
|
2845
|
+
yield put(actions.setSecurityPolicyGlobalState({ policy, loading: false }));
|
|
2846
|
+
}
|
|
2847
|
+
catch (e) {
|
|
2848
|
+
yield put(actions.setSecurityPolicyGlobalState({ error: e.message, loading: false }));
|
|
2849
|
+
}
|
|
2850
|
+
yield put(actions.loadSecurityPolicyMfa());
|
|
2851
|
+
yield put(actions.loadSecurityPolicyLockout());
|
|
2852
|
+
yield put(actions.loadSecurityPolicyCaptcha());
|
|
2853
|
+
}
|
|
2854
|
+
function* loadPublicSecurityPolicy() {
|
|
2855
|
+
yield put(actions.setSecurityPolicyPublicState({ loading: true, error: null }));
|
|
2856
|
+
try {
|
|
2857
|
+
const policy = yield call(api.auth.getVendorConfig);
|
|
2858
|
+
yield put(actions.setSecurityPolicyPublicState({ policy, loading: false }));
|
|
2859
|
+
}
|
|
2860
|
+
catch (e) {
|
|
2861
|
+
yield put(actions.setSecurityPolicyPublicState({ error: e.message, loading: false }));
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
function* loadSecurityPolicyMfa() {
|
|
2865
|
+
yield put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
2866
|
+
try {
|
|
2867
|
+
const policy = yield call(api.auth.getMfaPolicy);
|
|
2868
|
+
yield put(actions.setSecurityPolicyMfaState({ policy, loading: false }));
|
|
2869
|
+
}
|
|
2870
|
+
catch (e) {
|
|
2871
|
+
yield put(actions.setSecurityPolicyMfaState({ error: e.message, loading: false }));
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
function* saveSecurityPolicyMfa(_a) {
|
|
2875
|
+
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
2876
|
+
yield put(actions.setSecurityPolicyMfaState({ saving: true, error: null }));
|
|
2877
|
+
try {
|
|
2878
|
+
const policy = yield call(api.auth.saveMfaPolicy, newSecurityPolicy);
|
|
2879
|
+
yield put(actions.setSecurityPolicyMfaState({ policy, saving: false }));
|
|
2880
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
2881
|
+
}
|
|
2882
|
+
catch (e) {
|
|
2883
|
+
yield put(actions.setSecurityPolicyMfaState({ saving: false, error: e.message }));
|
|
2884
|
+
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
2885
|
+
}
|
|
2886
|
+
}
|
|
2887
|
+
function* loadSecurityPolicyLockout() {
|
|
2888
|
+
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
2889
|
+
try {
|
|
2890
|
+
const policy = yield call(api.auth.getLockoutPolicy);
|
|
2891
|
+
yield put(actions.setSecurityPolicyLockoutState({ policy, loading: false }));
|
|
2892
|
+
}
|
|
2893
|
+
catch (e) {
|
|
2894
|
+
yield put(actions.setSecurityPolicyLockoutState({ error: e.message, loading: false }));
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
function* saveSecurityPolicyLockout(_a) {
|
|
2898
|
+
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
2899
|
+
yield put(actions.setSecurityPolicyLockoutState({ saving: true, error: null }));
|
|
2900
|
+
try {
|
|
2901
|
+
const policy = yield call(api.auth.saveLockoutPolicy, newSecurityPolicy);
|
|
2902
|
+
yield put(actions.setSecurityPolicyLockoutState({ policy, saving: false }));
|
|
2903
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
2904
|
+
}
|
|
2905
|
+
catch (e) {
|
|
2906
|
+
yield put(actions.setSecurityPolicyLockoutState({ saving: false, error: e.message }));
|
|
2907
|
+
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2910
|
+
function* loadSecurityPolicyCaptcha() {
|
|
2911
|
+
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
2912
|
+
try {
|
|
2913
|
+
const policy = yield call(api.auth.getCaptchaPolicy);
|
|
2914
|
+
yield put(actions.setSecurityPolicyCaptchaState({ policy, loading: false }));
|
|
2915
|
+
}
|
|
2916
|
+
catch (e) {
|
|
2917
|
+
yield put(actions.setSecurityPolicyCaptchaState({ error: e.message, loading: false }));
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
function* loadSecurityPolicyPasswordHistory() {
|
|
2921
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ loading: true, error: null }));
|
|
2922
|
+
try {
|
|
2923
|
+
const policy = yield call(api.auth.getPasswordHistoryPolicy);
|
|
2924
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy, loading: false }));
|
|
2925
|
+
}
|
|
2926
|
+
catch (e) {
|
|
2927
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ error: e.message, loading: false }));
|
|
2928
|
+
}
|
|
2929
|
+
}
|
|
2930
|
+
function* saveSecurityPolicyPasswordHistory(_a) {
|
|
2931
|
+
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
2932
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ saving: true, error: null }));
|
|
2933
|
+
try {
|
|
2934
|
+
const policy = yield call(api.auth.savePasswordHistoryPolicy, newSecurityPolicy);
|
|
2935
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy, saving: false }));
|
|
2936
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
2937
|
+
}
|
|
2938
|
+
catch (e) {
|
|
2939
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ saving: false, error: e.message }));
|
|
2940
|
+
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
function* loadVendorPasswordConfig() {
|
|
2944
|
+
yield put(actions.setSecurityPolicyPasswordState({ loading: true, error: null }));
|
|
2945
|
+
try {
|
|
2946
|
+
const policy = yield call(api.auth.getPasswordConfigPolicy);
|
|
2947
|
+
yield put(actions.setSecurityPolicyPasswordState({ policy, loading: false }));
|
|
2948
|
+
}
|
|
2949
|
+
catch (e) {
|
|
2950
|
+
yield put(actions.setSecurityPolicyPasswordState({ error: e.message, loading: false }));
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
function* securityPolicySagas() {
|
|
2954
|
+
yield takeLeading(actions.loadSecurityPolicy, loadSecurityPolicy);
|
|
2955
|
+
yield takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfa);
|
|
2956
|
+
yield takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfa);
|
|
2957
|
+
yield takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockout);
|
|
2958
|
+
yield takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockout);
|
|
2959
|
+
yield takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptcha);
|
|
2960
|
+
yield takeEvery(actions.saveSecurityPolicyPasswordHistory, saveSecurityPolicyPasswordHistory);
|
|
2961
|
+
yield takeEvery(actions.loadSecurityPolicyPasswordHistory, loadSecurityPolicyPasswordHistory);
|
|
2962
|
+
yield takeEvery(actions.loadVendorPasswordConfig, loadVendorPasswordConfig);
|
|
2963
|
+
yield takeEvery(actions.loadPublicSecurityPolicy, loadPublicSecurityPolicy);
|
|
2964
|
+
}
|
|
2965
|
+
/*********************************
|
|
2966
|
+
* Preview Sagas
|
|
2967
|
+
*********************************/
|
|
2968
|
+
function* loadPublicSecurityPolicyMock() {
|
|
2969
|
+
yield put(actions.setSecurityPolicyPublicState({ loading: true, error: null }));
|
|
2970
|
+
try {
|
|
2971
|
+
yield put(actions.setSecurityPolicyPublicState({ policy: publicSecurityPolicy, loading: false }));
|
|
2972
|
+
}
|
|
2973
|
+
catch (e) {
|
|
2974
|
+
yield put(actions.setSecurityPolicyPublicState({ error: e.message, loading: false }));
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
function* loadSecurityPolicyMock() {
|
|
2978
|
+
yield put(actions.setSecurityPolicyGlobalState({ loading: true, error: null }));
|
|
2979
|
+
yield delay();
|
|
2980
|
+
yield put(actions.setSecurityPolicyGlobalState({ policy: policyDemo, loading: false }));
|
|
2981
|
+
yield put(actions.loadSecurityPolicyMfa());
|
|
2982
|
+
yield put(actions.loadSecurityPolicyLockout());
|
|
2983
|
+
yield put(actions.loadSecurityPolicyCaptcha());
|
|
2984
|
+
}
|
|
2985
|
+
function* loadSecurityPolicyMfaMock() {
|
|
2986
|
+
yield put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
2987
|
+
yield delay();
|
|
2988
|
+
yield put(actions.setSecurityPolicyMfaState({ policy: policyMfaDemo, loading: false }));
|
|
2989
|
+
}
|
|
2990
|
+
function* saveSecurityPolicyMfaMock(_a) {
|
|
2991
|
+
var _b;
|
|
2992
|
+
var _c = _a.payload, { callback } = _c, newSecurityPolicy = __rest(_c, ["callback"]);
|
|
2993
|
+
yield put(actions.setSecurityPolicyMfaState({ saving: true, error: null }));
|
|
2994
|
+
const policy = Object.assign(Object.assign({}, policyLockoutDemo), { id: (_b = newSecurityPolicy.id) !== null && _b !== void 0 ? _b : policyLockoutDemo.id, enforceMFAType: newSecurityPolicy.enforceMFAType });
|
|
2995
|
+
yield delay();
|
|
2996
|
+
yield put(actions.setSecurityPolicyMfaState({ policy, saving: false }));
|
|
2997
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
2998
|
+
}
|
|
2999
|
+
function* loadSecurityPolicyLockoutMock() {
|
|
3000
|
+
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
3001
|
+
yield delay();
|
|
3002
|
+
yield put(actions.setSecurityPolicyLockoutState({ policy: policyLockoutDemo, loading: false }));
|
|
3003
|
+
}
|
|
3004
|
+
function* saveSecurityPolicyLockoutMock(_a) {
|
|
3005
|
+
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
3006
|
+
yield put(actions.setSecurityPolicyLockoutState({ saving: true, error: null }));
|
|
3007
|
+
yield delay();
|
|
3008
|
+
const policy = Object.assign(Object.assign(Object.assign({}, newSecurityPolicy), policyLockoutDemo), { id: newSecurityPolicy.id ? newSecurityPolicy.id : policyLockoutDemo.id });
|
|
3009
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
3010
|
+
yield put(actions.setSecurityPolicyLockoutState({ policy, saving: false }));
|
|
3011
|
+
}
|
|
3012
|
+
function* loadSecurityPolicyCaptchaMock() {
|
|
3013
|
+
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
3014
|
+
yield delay();
|
|
3015
|
+
yield put(actions.setSecurityPolicyLockoutState({ policy: policyLockoutDemo, loading: false }));
|
|
3016
|
+
}
|
|
3017
|
+
function* loadSecurityPolicyPasswordHistoryMock() {
|
|
3018
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ loading: true, error: null }));
|
|
3019
|
+
yield delay();
|
|
3020
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy: policyPasswordHistoryDemo, loading: false }));
|
|
3021
|
+
}
|
|
3022
|
+
function* saveSecurityPolicyPasswordHistoryMock(_a) {
|
|
3023
|
+
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
3024
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ saving: true, error: null }));
|
|
3025
|
+
yield delay();
|
|
3026
|
+
const policy = Object.assign(Object.assign(Object.assign({}, newSecurityPolicy), policyPasswordHistoryDemo), { id: newSecurityPolicy.id ? newSecurityPolicy.id : policyPasswordHistoryDemo.id });
|
|
3027
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
3028
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy, saving: false }));
|
|
3029
|
+
}
|
|
3030
|
+
function* securityPolicySagasMock() {
|
|
3031
|
+
yield takeLeading(actions.loadSecurityPolicy, loadSecurityPolicyMock);
|
|
3032
|
+
yield takeEvery(actions.loadPublicSecurityPolicy, loadPublicSecurityPolicyMock);
|
|
3033
|
+
yield takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfaMock);
|
|
3034
|
+
yield takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfaMock);
|
|
3035
|
+
yield takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockoutMock);
|
|
3036
|
+
yield takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockoutMock);
|
|
3037
|
+
yield takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptchaMock);
|
|
3038
|
+
yield takeEvery(actions.saveSecurityPolicyPasswordHistory, saveSecurityPolicyPasswordHistoryMock);
|
|
3039
|
+
yield takeEvery(actions.loadSecurityPolicyPasswordHistory, loadSecurityPolicyPasswordHistoryMock);
|
|
3040
|
+
}
|
|
3041
|
+
|
|
3042
3042
|
function* saveAccountSettings({ payload }) {
|
|
3043
3043
|
var _a, _b;
|
|
3044
3044
|
try {
|
package/auth/reducer.d.ts
CHANGED
|
@@ -209,8 +209,10 @@ declare const actions: {
|
|
|
209
209
|
afterAuthNavigation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
210
210
|
preLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IPreLogin & {
|
|
211
211
|
recaptchaToken?: string | undefined;
|
|
212
|
+
invitationToken?: string | undefined;
|
|
212
213
|
}, void>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IPreLogin & {
|
|
213
214
|
recaptchaToken?: string | undefined;
|
|
215
|
+
invitationToken?: string | undefined;
|
|
214
216
|
}, void>, string, never, never>;
|
|
215
217
|
postLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IPostLogin], import("@frontegg/rest-api").IPostLogin, string, never, never>;
|
|
216
218
|
login: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").ILogin], import("@frontegg/rest-api").ILogin, string, never, never>;
|
package/connectivity/index.js
CHANGED
|
@@ -130,6 +130,7 @@ function* loadDataFunction({ payload = channels }) {
|
|
|
130
130
|
return res.reduce((acc, curr, idx) => (Object.assign(Object.assign({}, acc), { [`${payload[idx]}`]: curr })), {});
|
|
131
131
|
})(),
|
|
132
132
|
]);
|
|
133
|
+
const webhooks = yield loadFunction({ payload: { api: 'webhook' }, type: '' });
|
|
133
134
|
const data = values.reduce((acc, curr, idx) => payload[idx]
|
|
134
135
|
? values[values.length - 1][payload[idx]].length
|
|
135
136
|
? Object.assign(Object.assign({}, acc), { [`${payload[idx]}`]: curr, list: [
|
|
@@ -143,7 +144,7 @@ function* loadDataFunction({ payload = channels }) {
|
|
|
143
144
|
image: channels2Platform[payload[idx]].image,
|
|
144
145
|
},
|
|
145
146
|
] }) : acc
|
|
146
|
-
: Object.assign(Object.assign({}, acc), { [`${addApi[idx - payload.length]}`]: curr }), { list: [] });
|
|
147
|
+
: Object.assign(Object.assign({}, acc), { [`${addApi[idx - payload.length]}`]: curr }), { list: [], webhook: webhooks });
|
|
147
148
|
yield put(actions.setConnectivityState(Object.assign(Object.assign({}, data), { error: undefined, isSaving: false, isLoading: false })));
|
|
148
149
|
}
|
|
149
150
|
catch (e) {
|