@frontegg/redux-store 5.62.2 → 5.64.1
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/LoginState/index.d.ts +8 -2
- package/auth/LoginState/interfaces.d.ts +7 -0
- package/auth/LoginState/saga.d.ts +2 -0
- package/auth/TeamState/index.d.ts +2 -0
- package/auth/index.d.ts +4 -0
- package/auth/index.js +312 -242
- package/auth/reducer.d.ts +4 -0
- package/node/auth/index.js +1 -1
- package/node/{index-175a6fdc.js → index-deb612e3.js} +311 -241
- package/node/index.js +1 -1
- package/node/toolkit/index.js +1 -1
- package/package.json +2 -2
|
@@ -22,6 +22,7 @@ exports.LoginStep = void 0;
|
|
|
22
22
|
LoginStep["preLogin"] = "preLogin";
|
|
23
23
|
LoginStep["magicLinkPreLoginSuccess"] = "magicLinkPreLoginSuccess";
|
|
24
24
|
LoginStep["loginWithSmsOtc"] = "loginWithSmsOtc";
|
|
25
|
+
LoginStep["loginWithQuickSmsOtc"] = "loginWithQuickSmsOtc";
|
|
25
26
|
LoginStep["loginWithOtc"] = "loginWithOtc";
|
|
26
27
|
LoginStep["loginWithPassword"] = "loginWithPassword";
|
|
27
28
|
LoginStep["loginWithTwoFactor"] = "loginWithTwoFactor";
|
|
@@ -69,6 +70,9 @@ const actions$g = {
|
|
|
69
70
|
logout: toolkit.createAction(`${constants.authStoreName}/logout`, (payload) => ({ payload })),
|
|
70
71
|
silentLogout: toolkit.createAction(`${constants.authStoreName}/silentLogout`, (payload) => ({ payload })),
|
|
71
72
|
checkIfAllowToRememberMfaDevice: toolkit.createAction(`${constants.authStoreName}/checkIfAllowToRememberMfaDevice`, (payload) => ({ payload })),
|
|
73
|
+
changePhoneNumberWithVerification: toolkit.createAction(`${constants.authStoreName}/changePhoneNumberWithVerification`, (payload) => ({ payload })),
|
|
74
|
+
verifyChangePhoneNumber: toolkit.createAction(`${constants.authStoreName}/verifyChangePhoneNumber`, (payload) => ({ payload })),
|
|
75
|
+
quickSmsPasswordlessPreLogin: toolkit.createAction(`${constants.authStoreName}/quickSmsPasswordlessPreLogin`, (payload) => ({ payload })),
|
|
72
76
|
passwordlessPreLogin: toolkit.createAction(`${constants.authStoreName}/passwordlessPreLogin`, (payload) => ({ payload })),
|
|
73
77
|
passwordlessPostLogin: toolkit.createAction(`${constants.authStoreName}/passwordlessPostLogin`, (payload) => ({ payload })),
|
|
74
78
|
verifyInviteToken: toolkit.createAction(`${constants.authStoreName}/verifyInviteToken`, (payload) => ({ payload })),
|
|
@@ -313,6 +317,7 @@ const actions$8 = {
|
|
|
313
317
|
lockUser: toolkit.createAction(`${constants.authStoreName}/lockUser`, (payload) => ({ payload })),
|
|
314
318
|
resendActivationLink: toolkit.createAction(`${constants.authStoreName}/resendActivationLink`, (payload) => ({ payload })),
|
|
315
319
|
resendInvitationLink: toolkit.createAction(`${constants.authStoreName}/resendInvitationLink`, (payload) => ({ payload })),
|
|
320
|
+
resendInvitationLinkToAllSubTenants: toolkit.createAction(`${constants.authStoreName}/resendInvitationLinkToAllSubTenants`, (payload) => ({ payload })),
|
|
316
321
|
getInvitationLink: toolkit.createAction(`${constants.authStoreName}/getInvitationLink`),
|
|
317
322
|
createInvitationLink: toolkit.createAction(`${constants.authStoreName}/createInvitationLink`, (payload) => ({ payload })),
|
|
318
323
|
updateInvitationLink: toolkit.createAction(`${constants.authStoreName}/updateInvitationLink`, (payload) => ({ payload })),
|
|
@@ -674,9 +679,9 @@ const userProfileDemo = {
|
|
|
674
679
|
phoneNumber: '+972-54123456',
|
|
675
680
|
jobTitle: 'Developer',
|
|
676
681
|
address: {
|
|
677
|
-
city:
|
|
678
|
-
country:
|
|
679
|
-
}
|
|
682
|
+
city: 'Tel Aviv',
|
|
683
|
+
country: 'Israel',
|
|
684
|
+
},
|
|
680
685
|
}),
|
|
681
686
|
roleIds: undefined,
|
|
682
687
|
verified: undefined,
|
|
@@ -833,7 +838,6 @@ const userTeamDemo = {
|
|
|
833
838
|
const userSubTenantDemo = {
|
|
834
839
|
metadata: '',
|
|
835
840
|
mfaEnrolled: false,
|
|
836
|
-
permissions: [],
|
|
837
841
|
provider: '',
|
|
838
842
|
sub: '',
|
|
839
843
|
tenantIds: [],
|
|
@@ -843,10 +847,7 @@ const userSubTenantDemo = {
|
|
|
843
847
|
email: 'email',
|
|
844
848
|
name: 'name',
|
|
845
849
|
tenantId: 'tenantId',
|
|
846
|
-
activatedForTenant: true,
|
|
847
850
|
createdAt: new Date(),
|
|
848
|
-
lastLogin: new Date(),
|
|
849
|
-
roles: [],
|
|
850
851
|
};
|
|
851
852
|
const usersDemo = [userTeamDemo, userTeamDemo2];
|
|
852
853
|
const allUsersDemo = [userSubTenantDemo];
|
|
@@ -959,6 +960,238 @@ function* signUpSaga() {
|
|
|
959
960
|
yield effects.takeLeading(actions.resetSignUpStateSoft, resetSignUpStateSoft);
|
|
960
961
|
}
|
|
961
962
|
|
|
963
|
+
function* loadSecurityPolicy() {
|
|
964
|
+
yield effects.put(actions.setSecurityPolicyGlobalState({ loading: true, error: null }));
|
|
965
|
+
try {
|
|
966
|
+
const policy = yield effects.call(restApi.api.auth.getGlobalSecurityPolicy);
|
|
967
|
+
yield effects.put(actions.setSecurityPolicyGlobalState({ policy, loading: false }));
|
|
968
|
+
}
|
|
969
|
+
catch (e) {
|
|
970
|
+
yield effects.put(actions.setSecurityPolicyGlobalState({ error: e.message, loading: false }));
|
|
971
|
+
}
|
|
972
|
+
yield effects.put(actions.loadSecurityPolicyMfa());
|
|
973
|
+
yield effects.put(actions.loadSecurityPolicyVendorMfa());
|
|
974
|
+
yield effects.put(actions.loadSecurityPolicyLockout());
|
|
975
|
+
yield effects.put(actions.loadSecurityPolicyCaptcha());
|
|
976
|
+
yield effects.put(actions.loadPublicAuthStrategiesPolicy());
|
|
977
|
+
}
|
|
978
|
+
function* loadPublicSecurityPolicy() {
|
|
979
|
+
yield effects.put(actions.setSecurityPolicyPublicState({ loading: true, error: null }));
|
|
980
|
+
try {
|
|
981
|
+
const policy = yield effects.call(restApi.api.auth.getVendorConfig);
|
|
982
|
+
yield effects.put(actions.setSecurityPolicyPublicState({ policy, loading: false }));
|
|
983
|
+
}
|
|
984
|
+
catch (e) {
|
|
985
|
+
yield effects.put(actions.setSecurityPolicyPublicState({ error: e.message, loading: false }));
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
function* loadPublicAuthStrategiesPolicy() {
|
|
989
|
+
yield effects.put(actions.setSecurityPolicyAuthStrategyPublicState({ loading: true, error: null }));
|
|
990
|
+
try {
|
|
991
|
+
const policy = yield effects.call(restApi.api.auth.getVendorPublicAuthStrategiesConfig);
|
|
992
|
+
yield effects.put(actions.setSecurityPolicyAuthStrategyPublicState({ policy, loading: false }));
|
|
993
|
+
}
|
|
994
|
+
catch (e) {
|
|
995
|
+
yield effects.put(actions.setSecurityPolicyAuthStrategyPublicState({ error: e.message, loading: false }));
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
function* loadSecurityPolicyMfa() {
|
|
999
|
+
yield effects.put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
1000
|
+
try {
|
|
1001
|
+
const policy = yield effects.call(restApi.api.auth.getMfaPolicy);
|
|
1002
|
+
yield effects.put(actions.setSecurityPolicyMfaState({ policy, loading: false }));
|
|
1003
|
+
}
|
|
1004
|
+
catch (e) {
|
|
1005
|
+
yield effects.put(actions.setSecurityPolicyMfaState({ error: e.message, loading: false }));
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
function* loadSecurityPolicyVendorMfa() {
|
|
1009
|
+
yield effects.put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
1010
|
+
try {
|
|
1011
|
+
const policy = yield effects.call(restApi.api.auth.getVendorMfaPolicy);
|
|
1012
|
+
yield effects.put(actions.setSecurityPolicyVendorMfaState({ policy, loading: false }));
|
|
1013
|
+
}
|
|
1014
|
+
catch (e) {
|
|
1015
|
+
yield effects.put(actions.setSecurityPolicyVendorMfaState({ error: e.message, loading: false }));
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
function* saveSecurityPolicyMfa(_a) {
|
|
1019
|
+
var _b = _a.payload, { callback } = _b, newSecurityPolicy = tslib.__rest(_b, ["callback"]);
|
|
1020
|
+
yield effects.put(actions.setSecurityPolicyMfaState({ saving: true, error: null }));
|
|
1021
|
+
try {
|
|
1022
|
+
const policy = yield effects.call(restApi.api.auth.saveMfaPolicy, newSecurityPolicy);
|
|
1023
|
+
yield effects.put(actions.setSecurityPolicyMfaState({ policy, saving: false }));
|
|
1024
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
1025
|
+
}
|
|
1026
|
+
catch (e) {
|
|
1027
|
+
yield effects.put(actions.setSecurityPolicyMfaState({ saving: false, error: e.message }));
|
|
1028
|
+
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
function* loadSecurityPolicyLockout() {
|
|
1032
|
+
yield effects.put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
1033
|
+
try {
|
|
1034
|
+
const policy = yield effects.call(restApi.api.auth.getLockoutPolicy);
|
|
1035
|
+
yield effects.put(actions.setSecurityPolicyLockoutState({ policy, loading: false }));
|
|
1036
|
+
}
|
|
1037
|
+
catch (e) {
|
|
1038
|
+
yield effects.put(actions.setSecurityPolicyLockoutState({ error: e.message, loading: false }));
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
function* saveSecurityPolicyLockout(_a) {
|
|
1042
|
+
var _b = _a.payload, { callback } = _b, newSecurityPolicy = tslib.__rest(_b, ["callback"]);
|
|
1043
|
+
yield effects.put(actions.setSecurityPolicyLockoutState({ saving: true, error: null }));
|
|
1044
|
+
try {
|
|
1045
|
+
const policy = yield effects.call(restApi.api.auth.saveLockoutPolicy, newSecurityPolicy);
|
|
1046
|
+
yield effects.put(actions.setSecurityPolicyLockoutState({ policy, saving: false }));
|
|
1047
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
1048
|
+
}
|
|
1049
|
+
catch (e) {
|
|
1050
|
+
yield effects.put(actions.setSecurityPolicyLockoutState({ saving: false, error: e.message }));
|
|
1051
|
+
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
function* loadSecurityPolicyCaptcha() {
|
|
1055
|
+
yield effects.put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
1056
|
+
try {
|
|
1057
|
+
const policy = yield effects.call(restApi.api.auth.getCaptchaPolicy);
|
|
1058
|
+
yield effects.put(actions.setSecurityPolicyCaptchaState({ policy, loading: false }));
|
|
1059
|
+
}
|
|
1060
|
+
catch (e) {
|
|
1061
|
+
yield effects.put(actions.setSecurityPolicyCaptchaState({ error: e.message, loading: false }));
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
function* loadSecurityPolicyPasswordHistory() {
|
|
1065
|
+
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ loading: true, error: null }));
|
|
1066
|
+
try {
|
|
1067
|
+
const policy = yield effects.call(restApi.api.auth.getPasswordHistoryPolicy);
|
|
1068
|
+
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ policy, loading: false }));
|
|
1069
|
+
}
|
|
1070
|
+
catch (e) {
|
|
1071
|
+
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ error: e.message, loading: false }));
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
function* saveSecurityPolicyPasswordHistory(_a) {
|
|
1075
|
+
var _b = _a.payload, { callback } = _b, newSecurityPolicy = tslib.__rest(_b, ["callback"]);
|
|
1076
|
+
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ saving: true, error: null }));
|
|
1077
|
+
try {
|
|
1078
|
+
const policy = yield effects.call(restApi.api.auth.savePasswordHistoryPolicy, newSecurityPolicy);
|
|
1079
|
+
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ policy, saving: false }));
|
|
1080
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
1081
|
+
}
|
|
1082
|
+
catch (e) {
|
|
1083
|
+
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ saving: false, error: e.message }));
|
|
1084
|
+
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
function* loadVendorPasswordConfig() {
|
|
1088
|
+
yield effects.put(actions.setSecurityPolicyPasswordState({ loading: true, error: null }));
|
|
1089
|
+
try {
|
|
1090
|
+
const policy = yield effects.call(restApi.api.auth.getPasswordConfigPolicy);
|
|
1091
|
+
yield effects.put(actions.setSecurityPolicyPasswordState({ policy, loading: false }));
|
|
1092
|
+
}
|
|
1093
|
+
catch (e) {
|
|
1094
|
+
yield effects.put(actions.setSecurityPolicyPasswordState({ error: e.message, loading: false }));
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
function* securityPolicySagas() {
|
|
1098
|
+
yield effects.takeLeading(actions.loadSecurityPolicy, loadSecurityPolicy);
|
|
1099
|
+
yield effects.takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfa);
|
|
1100
|
+
yield effects.takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfa);
|
|
1101
|
+
yield effects.takeEvery(actions.loadSecurityPolicyVendorMfa, loadSecurityPolicyVendorMfa);
|
|
1102
|
+
yield effects.takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockout);
|
|
1103
|
+
yield effects.takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockout);
|
|
1104
|
+
yield effects.takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptcha);
|
|
1105
|
+
yield effects.takeEvery(actions.saveSecurityPolicyPasswordHistory, saveSecurityPolicyPasswordHistory);
|
|
1106
|
+
yield effects.takeEvery(actions.loadSecurityPolicyPasswordHistory, loadSecurityPolicyPasswordHistory);
|
|
1107
|
+
yield effects.takeEvery(actions.loadVendorPasswordConfig, loadVendorPasswordConfig);
|
|
1108
|
+
yield effects.takeEvery(actions.loadPublicSecurityPolicy, loadPublicSecurityPolicy);
|
|
1109
|
+
yield effects.takeEvery(actions.loadPublicAuthStrategiesPolicy, loadPublicAuthStrategiesPolicy);
|
|
1110
|
+
}
|
|
1111
|
+
/*********************************
|
|
1112
|
+
* Preview Sagas
|
|
1113
|
+
*********************************/
|
|
1114
|
+
function* loadPublicSecurityPolicyMock() {
|
|
1115
|
+
yield effects.put(actions.setSecurityPolicyPublicState({ loading: true, error: null }));
|
|
1116
|
+
try {
|
|
1117
|
+
yield effects.put(actions.setSecurityPolicyPublicState({ policy: publicSecurityPolicy, loading: false }));
|
|
1118
|
+
}
|
|
1119
|
+
catch (e) {
|
|
1120
|
+
yield effects.put(actions.setSecurityPolicyPublicState({ error: e.message, loading: false }));
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
function* loadSecurityPolicyMock() {
|
|
1124
|
+
yield effects.put(actions.setSecurityPolicyGlobalState({ loading: true, error: null }));
|
|
1125
|
+
yield vendor_index.delay();
|
|
1126
|
+
yield effects.put(actions.setSecurityPolicyGlobalState({ policy: policyDemo, loading: false }));
|
|
1127
|
+
yield effects.put(actions.loadSecurityPolicyMfa());
|
|
1128
|
+
yield effects.put(actions.loadSecurityPolicyVendorMfa());
|
|
1129
|
+
yield effects.put(actions.loadSecurityPolicyLockout());
|
|
1130
|
+
yield effects.put(actions.loadSecurityPolicyCaptcha());
|
|
1131
|
+
}
|
|
1132
|
+
function* loadSecurityPolicyMfaMock() {
|
|
1133
|
+
yield effects.put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
1134
|
+
yield vendor_index.delay();
|
|
1135
|
+
yield effects.put(actions.setSecurityPolicyMfaState({ policy: policyMfaDemo, loading: false }));
|
|
1136
|
+
}
|
|
1137
|
+
function* loadSecurityPolicyVendorMfaMock() {
|
|
1138
|
+
yield effects.put(actions.setSecurityPolicyVendorMfaState({ loading: true, error: null }));
|
|
1139
|
+
yield vendor_index.delay();
|
|
1140
|
+
yield effects.put(actions.setSecurityPolicyVendorMfaState({ policy: policyMfaDemo, loading: false }));
|
|
1141
|
+
}
|
|
1142
|
+
function* saveSecurityPolicyMfaMock(_a) {
|
|
1143
|
+
var _b;
|
|
1144
|
+
var _c = _a.payload, { callback } = _c, newSecurityPolicy = tslib.__rest(_c, ["callback"]);
|
|
1145
|
+
yield effects.put(actions.setSecurityPolicyMfaState({ saving: true, error: null }));
|
|
1146
|
+
const policy = Object.assign(Object.assign({}, policyLockoutDemo), { id: (_b = newSecurityPolicy.id) !== null && _b !== void 0 ? _b : policyLockoutDemo.id, enforceMFAType: newSecurityPolicy.enforceMFAType });
|
|
1147
|
+
yield vendor_index.delay();
|
|
1148
|
+
yield effects.put(actions.setSecurityPolicyMfaState({ policy, saving: false }));
|
|
1149
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
1150
|
+
}
|
|
1151
|
+
function* loadSecurityPolicyLockoutMock() {
|
|
1152
|
+
yield effects.put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
1153
|
+
yield vendor_index.delay();
|
|
1154
|
+
yield effects.put(actions.setSecurityPolicyLockoutState({ policy: policyLockoutDemo, loading: false }));
|
|
1155
|
+
}
|
|
1156
|
+
function* saveSecurityPolicyLockoutMock(_a) {
|
|
1157
|
+
var _b = _a.payload, { callback } = _b, newSecurityPolicy = tslib.__rest(_b, ["callback"]);
|
|
1158
|
+
yield effects.put(actions.setSecurityPolicyLockoutState({ saving: true, error: null }));
|
|
1159
|
+
yield vendor_index.delay();
|
|
1160
|
+
const policy = Object.assign(Object.assign(Object.assign({}, newSecurityPolicy), policyLockoutDemo), { id: newSecurityPolicy.id ? newSecurityPolicy.id : policyLockoutDemo.id });
|
|
1161
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
1162
|
+
yield effects.put(actions.setSecurityPolicyLockoutState({ policy, saving: false }));
|
|
1163
|
+
}
|
|
1164
|
+
function* loadSecurityPolicyCaptchaMock() {
|
|
1165
|
+
yield effects.put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
1166
|
+
yield vendor_index.delay();
|
|
1167
|
+
yield effects.put(actions.setSecurityPolicyLockoutState({ policy: policyLockoutDemo, loading: false }));
|
|
1168
|
+
}
|
|
1169
|
+
function* loadSecurityPolicyPasswordHistoryMock() {
|
|
1170
|
+
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ loading: true, error: null }));
|
|
1171
|
+
yield vendor_index.delay();
|
|
1172
|
+
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ policy: policyPasswordHistoryDemo, loading: false }));
|
|
1173
|
+
}
|
|
1174
|
+
function* saveSecurityPolicyPasswordHistoryMock(_a) {
|
|
1175
|
+
var _b = _a.payload, { callback } = _b, newSecurityPolicy = tslib.__rest(_b, ["callback"]);
|
|
1176
|
+
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ saving: true, error: null }));
|
|
1177
|
+
yield vendor_index.delay();
|
|
1178
|
+
const policy = Object.assign(Object.assign(Object.assign({}, newSecurityPolicy), policyPasswordHistoryDemo), { id: newSecurityPolicy.id ? newSecurityPolicy.id : policyPasswordHistoryDemo.id });
|
|
1179
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
1180
|
+
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ policy, saving: false }));
|
|
1181
|
+
}
|
|
1182
|
+
function* securityPolicySagasMock() {
|
|
1183
|
+
yield effects.takeLeading(actions.loadSecurityPolicy, loadSecurityPolicyMock);
|
|
1184
|
+
yield effects.takeEvery(actions.loadPublicSecurityPolicy, loadPublicSecurityPolicyMock);
|
|
1185
|
+
yield effects.takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfaMock);
|
|
1186
|
+
yield effects.takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfaMock);
|
|
1187
|
+
yield effects.takeEvery(actions.loadSecurityPolicyVendorMfa, loadSecurityPolicyVendorMfaMock);
|
|
1188
|
+
yield effects.takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockoutMock);
|
|
1189
|
+
yield effects.takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockoutMock);
|
|
1190
|
+
yield effects.takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptchaMock);
|
|
1191
|
+
yield effects.takeEvery(actions.saveSecurityPolicyPasswordHistory, saveSecurityPolicyPasswordHistoryMock);
|
|
1192
|
+
yield effects.takeEvery(actions.loadSecurityPolicyPasswordHistory, loadSecurityPolicyPasswordHistoryMock);
|
|
1193
|
+
}
|
|
1194
|
+
|
|
962
1195
|
const authStrategyLoginStepMap = {
|
|
963
1196
|
[restApi.AuthStrategyEnum.Code]: exports.LoginStep.loginWithOtc,
|
|
964
1197
|
[restApi.AuthStrategyEnum.EmailAndPassword]: exports.LoginStep.loginWithPassword,
|
|
@@ -1089,6 +1322,7 @@ function* requestAuthorize({ payload: firstTime }) {
|
|
|
1089
1322
|
yield effects.put(actions.setState({ isLoading: true }));
|
|
1090
1323
|
yield effects.put(actions.loadSocialLoginsConfigurationV2());
|
|
1091
1324
|
calls.push(effects.call(loadAllowSignUps));
|
|
1325
|
+
calls.push(effects.call(loadPublicAuthStrategiesPolicy));
|
|
1092
1326
|
calls.push(effects.call(loadSSOPublicConfigurationFunction));
|
|
1093
1327
|
calls.push(effects.call(vendor_index.loadVendorPublicInfo));
|
|
1094
1328
|
calls.push(effects.call(refreshMetadata));
|
|
@@ -1182,6 +1416,48 @@ function* handleHostedLoginCallback({ payload }) {
|
|
|
1182
1416
|
yield effects.put(actions.loadTenants());
|
|
1183
1417
|
yield afterAuthNavigation();
|
|
1184
1418
|
}
|
|
1419
|
+
function* changePhoneNumberWithVerification(_a) {
|
|
1420
|
+
var _b = _a.payload, { callback } = _b, payload = tslib.__rest(_b, ["callback"]);
|
|
1421
|
+
try {
|
|
1422
|
+
yield effects.put(actions.setLoginState({ loading: true }));
|
|
1423
|
+
const changePhoneRes = yield effects.call(restApi.api.auth.changePhoneNumberWithVerification, payload);
|
|
1424
|
+
yield effects.put(actions.setLoginState({ phoneNumber: payload.phoneNumber, loading: false, changePhoneId: changePhoneRes.changePhoneId, step: exports.LoginStep.loginWithQuickSmsOtc, error: undefined }));
|
|
1425
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1426
|
+
}
|
|
1427
|
+
catch (e) {
|
|
1428
|
+
yield effects.put(actions.setLoginState({ error: e.message, loading: false }));
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
function* verifyChangePhoneNumber(_a) {
|
|
1432
|
+
var _b = _a.payload, { callback } = _b, payload = tslib.__rest(_b, ["callback"]);
|
|
1433
|
+
try {
|
|
1434
|
+
yield effects.put(actions.setLoginState({ loading: true }));
|
|
1435
|
+
yield effects.call(restApi.api.auth.verifyChangePhoneNumber, payload);
|
|
1436
|
+
yield effects.put(actions.setLoginState({ loading: false }));
|
|
1437
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1438
|
+
}
|
|
1439
|
+
catch (e) {
|
|
1440
|
+
yield effects.put(actions.setLoginState({ error: e.message, loading: false }));
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
function* quickSmsPasswordlessPreLogin(_a) {
|
|
1444
|
+
var _b = _a.payload, { callback } = _b, payload = tslib.__rest(_b, ["callback"]);
|
|
1445
|
+
try {
|
|
1446
|
+
yield effects.put(actions.setLoginState({ loading: true }));
|
|
1447
|
+
const preloginRes = yield effects.call(restApi.api.auth.passwordlessPreLogin, Object.assign(Object.assign({}, payload), { type: restApi.AuthStrategyEnum.SmsCode }));
|
|
1448
|
+
yield effects.put(actions.setLoginState({
|
|
1449
|
+
step: exports.LoginStep.loginWithQuickSmsOtc,
|
|
1450
|
+
loading: false,
|
|
1451
|
+
email: payload.email,
|
|
1452
|
+
phoneNumber: preloginRes === null || preloginRes === void 0 ? void 0 : preloginRes.phoneNumber,
|
|
1453
|
+
}));
|
|
1454
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1455
|
+
}
|
|
1456
|
+
catch (e) {
|
|
1457
|
+
yield effects.put(actions.setLoginState({ error: e.message, loading: false }));
|
|
1458
|
+
callback === null || callback === void 0 ? void 0 : callback(e);
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1185
1461
|
function* passwordlessPreLogin(_a) {
|
|
1186
1462
|
var _b = _a.payload, { callback } = _b, payload = tslib.__rest(_b, ["callback"]);
|
|
1187
1463
|
try {
|
|
@@ -1557,6 +1833,9 @@ function* loginSagas() {
|
|
|
1557
1833
|
yield effects.takeLeading(actions.silentLogout, silentLogout);
|
|
1558
1834
|
yield effects.takeLeading(actions.loginWithMfa, loginWithMfa);
|
|
1559
1835
|
yield effects.takeLeading(actions.recoverMfa, recoverMfa);
|
|
1836
|
+
yield effects.takeLeading(actions.quickSmsPasswordlessPreLogin, quickSmsPasswordlessPreLogin);
|
|
1837
|
+
yield effects.takeLeading(actions.changePhoneNumberWithVerification, changePhoneNumberWithVerification);
|
|
1838
|
+
yield effects.takeLeading(actions.verifyChangePhoneNumber, verifyChangePhoneNumber);
|
|
1560
1839
|
yield effects.takeLeading(actions.passwordlessPreLogin, passwordlessPreLogin);
|
|
1561
1840
|
yield effects.takeLeading(actions.passwordlessPostLogin, passwordlessPostLogin);
|
|
1562
1841
|
yield effects.takeLeading(actions.verifyInviteToken, verifyInviteToken);
|
|
@@ -2784,8 +3063,9 @@ function* setUserRolesForSubTenants({ payload, }) {
|
|
|
2784
3063
|
try {
|
|
2785
3064
|
yield effects.call(restApi.api.subTenants.setUserRolesForSubTenants, userId, body);
|
|
2786
3065
|
const updatedUser = teamState.allUsers.find((user) => user.id === userId);
|
|
3066
|
+
let newTenants = [];
|
|
2787
3067
|
if (updatedUser) {
|
|
2788
|
-
|
|
3068
|
+
newTenants = updatedUser.tenants.map((tenant) => {
|
|
2789
3069
|
var _a;
|
|
2790
3070
|
return (Object.assign(Object.assign({}, tenant), { roles: ((_a = body.subTenantsRoles
|
|
2791
3071
|
.find((roleUpdate) => roleUpdate.tenantId === tenant.tenantId)) === null || _a === void 0 ? void 0 : _a.roleIds.map((roleId) => {
|
|
@@ -2797,7 +3077,7 @@ function* setUserRolesForSubTenants({ payload, }) {
|
|
|
2797
3077
|
yield effects.put(actions.setTeamState({
|
|
2798
3078
|
allUsers: [
|
|
2799
3079
|
...teamState.allUsers.filter((user) => user.id !== userId),
|
|
2800
|
-
...(updatedUser ? [updatedUser] : []),
|
|
3080
|
+
...(updatedUser ? [Object.assign(Object.assign({}, updatedUser), { tenants: newTenants })] : []),
|
|
2801
3081
|
],
|
|
2802
3082
|
addUserDialogState: { open: false, loading: false },
|
|
2803
3083
|
}));
|
|
@@ -2855,6 +3135,19 @@ function* resendInvitationLink({ payload }) {
|
|
|
2855
3135
|
}
|
|
2856
3136
|
yield effects.put(actions.setTeamLoader({ key: exports.TeamStateKeys.RESEND_INVITATION_LINK, value: false }));
|
|
2857
3137
|
}
|
|
3138
|
+
function* resendInvitationLinkToAllSubTenants({ payload, }) {
|
|
3139
|
+
const { callback } = payload, body = tslib.__rest(payload, ["callback"]);
|
|
3140
|
+
yield effects.put(actions.setTeamLoader({ key: exports.TeamStateKeys.RESEND_INVITATION_LINK, value: body.email }));
|
|
3141
|
+
try {
|
|
3142
|
+
yield effects.call(restApi.api.teams.resendInvitationLinkToAllTenants, body);
|
|
3143
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
3144
|
+
}
|
|
3145
|
+
catch (e) {
|
|
3146
|
+
yield effects.put(actions.setTeamError({ key: exports.TeamStateKeys.RESEND_INVITATION_LINK, value: e.message }));
|
|
3147
|
+
callback === null || callback === void 0 ? void 0 : callback(null, e.message);
|
|
3148
|
+
}
|
|
3149
|
+
yield effects.put(actions.setTeamLoader({ key: exports.TeamStateKeys.RESEND_INVITATION_LINK, value: false }));
|
|
3150
|
+
}
|
|
2858
3151
|
function* getInvitationLinkConfig() {
|
|
2859
3152
|
yield effects.put(actions.setTeamError({ key: exports.TeamStateKeys.CONFIG_TOKEN_LINK, value: false }));
|
|
2860
3153
|
try {
|
|
@@ -2962,6 +3255,7 @@ function* teamSagas() {
|
|
|
2962
3255
|
yield effects.takeEvery(actions.deleteUserFromSubTenants, deleteUserFromSubTenants);
|
|
2963
3256
|
yield effects.takeEvery(actions.resendActivationLink, resendActivationLink);
|
|
2964
3257
|
yield effects.takeEvery(actions.resendInvitationLink, resendInvitationLink);
|
|
3258
|
+
yield effects.takeEvery(actions.resendInvitationLinkToAllSubTenants, resendInvitationLinkToAllSubTenants);
|
|
2965
3259
|
yield effects.takeEvery(actions.getInvitationLink, getInvitationLink);
|
|
2966
3260
|
yield effects.takeEvery(actions.createInvitationLink, createInvitationLink);
|
|
2967
3261
|
yield effects.takeEvery(actions.updateInvitationLink, updateInvitationLink);
|
|
@@ -3125,6 +3419,13 @@ function* resendInvitationLinkMock({ payload }) {
|
|
|
3125
3419
|
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
3126
3420
|
yield effects.put(actions.setTeamLoader({ key: exports.TeamStateKeys.RESEND_INVITATION_LINK, value: false }));
|
|
3127
3421
|
}
|
|
3422
|
+
function* resendInvitationLinkToAllSubTenantsMock({ payload, }) {
|
|
3423
|
+
const { callback } = payload, body = tslib.__rest(payload, ["callback"]);
|
|
3424
|
+
yield effects.put(actions.setTeamLoader({ key: exports.TeamStateKeys.RESEND_INVITATION_LINK, value: body.email }));
|
|
3425
|
+
yield vendor_index.delay();
|
|
3426
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
3427
|
+
yield effects.put(actions.setTeamLoader({ key: exports.TeamStateKeys.RESEND_INVITATION_LINK, value: false }));
|
|
3428
|
+
}
|
|
3128
3429
|
function* teamSagasMock() {
|
|
3129
3430
|
yield effects.takeLatest(actions.loadUsers, loadUsersMock);
|
|
3130
3431
|
yield effects.takeLatest(actions.loadAllSubTenantsUsers, loadAllSubTenantsUsersMock);
|
|
@@ -3136,6 +3437,7 @@ function* teamSagasMock() {
|
|
|
3136
3437
|
yield effects.takeEvery(actions.deleteUserFromSubTenants, deleteUserFromSubTenantsMock);
|
|
3137
3438
|
yield effects.takeEvery(actions.resendActivationLink, resendActivationLinkMock);
|
|
3138
3439
|
yield effects.takeEvery(actions.resendInvitationLink, resendInvitationLinkMock);
|
|
3440
|
+
yield effects.takeEvery(actions.resendInvitationLinkToAllSubTenants, resendInvitationLinkToAllSubTenantsMock);
|
|
3139
3441
|
yield effects.takeEvery(actions.openAddUserDialog, openAddUserDialog);
|
|
3140
3442
|
yield effects.takeEvery(actions.closeAddUserDialog, closeAddUserDialog);
|
|
3141
3443
|
yield effects.takeEvery(actions.openDeleteUserDialog, openDeleteUserDialog);
|
|
@@ -3422,238 +3724,6 @@ function* apiTokensSagaMock() {
|
|
|
3422
3724
|
yield effects.takeLatest(actions.deleteTenantApiToken, deleteTenantApiTokenMock);
|
|
3423
3725
|
}
|
|
3424
3726
|
|
|
3425
|
-
function* loadSecurityPolicy() {
|
|
3426
|
-
yield effects.put(actions.setSecurityPolicyGlobalState({ loading: true, error: null }));
|
|
3427
|
-
try {
|
|
3428
|
-
const policy = yield effects.call(restApi.api.auth.getGlobalSecurityPolicy);
|
|
3429
|
-
yield effects.put(actions.setSecurityPolicyGlobalState({ policy, loading: false }));
|
|
3430
|
-
}
|
|
3431
|
-
catch (e) {
|
|
3432
|
-
yield effects.put(actions.setSecurityPolicyGlobalState({ error: e.message, loading: false }));
|
|
3433
|
-
}
|
|
3434
|
-
yield effects.put(actions.loadSecurityPolicyMfa());
|
|
3435
|
-
yield effects.put(actions.loadSecurityPolicyVendorMfa());
|
|
3436
|
-
yield effects.put(actions.loadSecurityPolicyLockout());
|
|
3437
|
-
yield effects.put(actions.loadSecurityPolicyCaptcha());
|
|
3438
|
-
yield effects.put(actions.loadPublicAuthStrategiesPolicy());
|
|
3439
|
-
}
|
|
3440
|
-
function* loadPublicSecurityPolicy() {
|
|
3441
|
-
yield effects.put(actions.setSecurityPolicyPublicState({ loading: true, error: null }));
|
|
3442
|
-
try {
|
|
3443
|
-
const policy = yield effects.call(restApi.api.auth.getVendorConfig);
|
|
3444
|
-
yield effects.put(actions.setSecurityPolicyPublicState({ policy, loading: false }));
|
|
3445
|
-
}
|
|
3446
|
-
catch (e) {
|
|
3447
|
-
yield effects.put(actions.setSecurityPolicyPublicState({ error: e.message, loading: false }));
|
|
3448
|
-
}
|
|
3449
|
-
}
|
|
3450
|
-
function* loadPublicAuthStrategiesPolicy() {
|
|
3451
|
-
yield effects.put(actions.setSecurityPolicyAuthStrategyPublicState({ loading: true, error: null }));
|
|
3452
|
-
try {
|
|
3453
|
-
const policy = yield effects.call(restApi.api.auth.getVendorPublicAuthStrategiesConfig);
|
|
3454
|
-
yield effects.put(actions.setSecurityPolicyAuthStrategyPublicState({ policy, loading: false }));
|
|
3455
|
-
}
|
|
3456
|
-
catch (e) {
|
|
3457
|
-
yield effects.put(actions.setSecurityPolicyAuthStrategyPublicState({ error: e.message, loading: false }));
|
|
3458
|
-
}
|
|
3459
|
-
}
|
|
3460
|
-
function* loadSecurityPolicyMfa() {
|
|
3461
|
-
yield effects.put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
3462
|
-
try {
|
|
3463
|
-
const policy = yield effects.call(restApi.api.auth.getMfaPolicy);
|
|
3464
|
-
yield effects.put(actions.setSecurityPolicyMfaState({ policy, loading: false }));
|
|
3465
|
-
}
|
|
3466
|
-
catch (e) {
|
|
3467
|
-
yield effects.put(actions.setSecurityPolicyMfaState({ error: e.message, loading: false }));
|
|
3468
|
-
}
|
|
3469
|
-
}
|
|
3470
|
-
function* loadSecurityPolicyVendorMfa() {
|
|
3471
|
-
yield effects.put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
3472
|
-
try {
|
|
3473
|
-
const policy = yield effects.call(restApi.api.auth.getVendorMfaPolicy);
|
|
3474
|
-
yield effects.put(actions.setSecurityPolicyVendorMfaState({ policy, loading: false }));
|
|
3475
|
-
}
|
|
3476
|
-
catch (e) {
|
|
3477
|
-
yield effects.put(actions.setSecurityPolicyVendorMfaState({ error: e.message, loading: false }));
|
|
3478
|
-
}
|
|
3479
|
-
}
|
|
3480
|
-
function* saveSecurityPolicyMfa(_a) {
|
|
3481
|
-
var _b = _a.payload, { callback } = _b, newSecurityPolicy = tslib.__rest(_b, ["callback"]);
|
|
3482
|
-
yield effects.put(actions.setSecurityPolicyMfaState({ saving: true, error: null }));
|
|
3483
|
-
try {
|
|
3484
|
-
const policy = yield effects.call(restApi.api.auth.saveMfaPolicy, newSecurityPolicy);
|
|
3485
|
-
yield effects.put(actions.setSecurityPolicyMfaState({ policy, saving: false }));
|
|
3486
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
3487
|
-
}
|
|
3488
|
-
catch (e) {
|
|
3489
|
-
yield effects.put(actions.setSecurityPolicyMfaState({ saving: false, error: e.message }));
|
|
3490
|
-
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
3491
|
-
}
|
|
3492
|
-
}
|
|
3493
|
-
function* loadSecurityPolicyLockout() {
|
|
3494
|
-
yield effects.put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
3495
|
-
try {
|
|
3496
|
-
const policy = yield effects.call(restApi.api.auth.getLockoutPolicy);
|
|
3497
|
-
yield effects.put(actions.setSecurityPolicyLockoutState({ policy, loading: false }));
|
|
3498
|
-
}
|
|
3499
|
-
catch (e) {
|
|
3500
|
-
yield effects.put(actions.setSecurityPolicyLockoutState({ error: e.message, loading: false }));
|
|
3501
|
-
}
|
|
3502
|
-
}
|
|
3503
|
-
function* saveSecurityPolicyLockout(_a) {
|
|
3504
|
-
var _b = _a.payload, { callback } = _b, newSecurityPolicy = tslib.__rest(_b, ["callback"]);
|
|
3505
|
-
yield effects.put(actions.setSecurityPolicyLockoutState({ saving: true, error: null }));
|
|
3506
|
-
try {
|
|
3507
|
-
const policy = yield effects.call(restApi.api.auth.saveLockoutPolicy, newSecurityPolicy);
|
|
3508
|
-
yield effects.put(actions.setSecurityPolicyLockoutState({ policy, saving: false }));
|
|
3509
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
3510
|
-
}
|
|
3511
|
-
catch (e) {
|
|
3512
|
-
yield effects.put(actions.setSecurityPolicyLockoutState({ saving: false, error: e.message }));
|
|
3513
|
-
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
3514
|
-
}
|
|
3515
|
-
}
|
|
3516
|
-
function* loadSecurityPolicyCaptcha() {
|
|
3517
|
-
yield effects.put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
3518
|
-
try {
|
|
3519
|
-
const policy = yield effects.call(restApi.api.auth.getCaptchaPolicy);
|
|
3520
|
-
yield effects.put(actions.setSecurityPolicyCaptchaState({ policy, loading: false }));
|
|
3521
|
-
}
|
|
3522
|
-
catch (e) {
|
|
3523
|
-
yield effects.put(actions.setSecurityPolicyCaptchaState({ error: e.message, loading: false }));
|
|
3524
|
-
}
|
|
3525
|
-
}
|
|
3526
|
-
function* loadSecurityPolicyPasswordHistory() {
|
|
3527
|
-
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ loading: true, error: null }));
|
|
3528
|
-
try {
|
|
3529
|
-
const policy = yield effects.call(restApi.api.auth.getPasswordHistoryPolicy);
|
|
3530
|
-
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ policy, loading: false }));
|
|
3531
|
-
}
|
|
3532
|
-
catch (e) {
|
|
3533
|
-
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ error: e.message, loading: false }));
|
|
3534
|
-
}
|
|
3535
|
-
}
|
|
3536
|
-
function* saveSecurityPolicyPasswordHistory(_a) {
|
|
3537
|
-
var _b = _a.payload, { callback } = _b, newSecurityPolicy = tslib.__rest(_b, ["callback"]);
|
|
3538
|
-
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ saving: true, error: null }));
|
|
3539
|
-
try {
|
|
3540
|
-
const policy = yield effects.call(restApi.api.auth.savePasswordHistoryPolicy, newSecurityPolicy);
|
|
3541
|
-
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ policy, saving: false }));
|
|
3542
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
3543
|
-
}
|
|
3544
|
-
catch (e) {
|
|
3545
|
-
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ saving: false, error: e.message }));
|
|
3546
|
-
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
3547
|
-
}
|
|
3548
|
-
}
|
|
3549
|
-
function* loadVendorPasswordConfig() {
|
|
3550
|
-
yield effects.put(actions.setSecurityPolicyPasswordState({ loading: true, error: null }));
|
|
3551
|
-
try {
|
|
3552
|
-
const policy = yield effects.call(restApi.api.auth.getPasswordConfigPolicy);
|
|
3553
|
-
yield effects.put(actions.setSecurityPolicyPasswordState({ policy, loading: false }));
|
|
3554
|
-
}
|
|
3555
|
-
catch (e) {
|
|
3556
|
-
yield effects.put(actions.setSecurityPolicyPasswordState({ error: e.message, loading: false }));
|
|
3557
|
-
}
|
|
3558
|
-
}
|
|
3559
|
-
function* securityPolicySagas() {
|
|
3560
|
-
yield effects.takeLeading(actions.loadSecurityPolicy, loadSecurityPolicy);
|
|
3561
|
-
yield effects.takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfa);
|
|
3562
|
-
yield effects.takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfa);
|
|
3563
|
-
yield effects.takeEvery(actions.loadSecurityPolicyVendorMfa, loadSecurityPolicyVendorMfa);
|
|
3564
|
-
yield effects.takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockout);
|
|
3565
|
-
yield effects.takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockout);
|
|
3566
|
-
yield effects.takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptcha);
|
|
3567
|
-
yield effects.takeEvery(actions.saveSecurityPolicyPasswordHistory, saveSecurityPolicyPasswordHistory);
|
|
3568
|
-
yield effects.takeEvery(actions.loadSecurityPolicyPasswordHistory, loadSecurityPolicyPasswordHistory);
|
|
3569
|
-
yield effects.takeEvery(actions.loadVendorPasswordConfig, loadVendorPasswordConfig);
|
|
3570
|
-
yield effects.takeEvery(actions.loadPublicSecurityPolicy, loadPublicSecurityPolicy);
|
|
3571
|
-
yield effects.takeEvery(actions.loadPublicAuthStrategiesPolicy, loadPublicAuthStrategiesPolicy);
|
|
3572
|
-
}
|
|
3573
|
-
/*********************************
|
|
3574
|
-
* Preview Sagas
|
|
3575
|
-
*********************************/
|
|
3576
|
-
function* loadPublicSecurityPolicyMock() {
|
|
3577
|
-
yield effects.put(actions.setSecurityPolicyPublicState({ loading: true, error: null }));
|
|
3578
|
-
try {
|
|
3579
|
-
yield effects.put(actions.setSecurityPolicyPublicState({ policy: publicSecurityPolicy, loading: false }));
|
|
3580
|
-
}
|
|
3581
|
-
catch (e) {
|
|
3582
|
-
yield effects.put(actions.setSecurityPolicyPublicState({ error: e.message, loading: false }));
|
|
3583
|
-
}
|
|
3584
|
-
}
|
|
3585
|
-
function* loadSecurityPolicyMock() {
|
|
3586
|
-
yield effects.put(actions.setSecurityPolicyGlobalState({ loading: true, error: null }));
|
|
3587
|
-
yield vendor_index.delay();
|
|
3588
|
-
yield effects.put(actions.setSecurityPolicyGlobalState({ policy: policyDemo, loading: false }));
|
|
3589
|
-
yield effects.put(actions.loadSecurityPolicyMfa());
|
|
3590
|
-
yield effects.put(actions.loadSecurityPolicyVendorMfa());
|
|
3591
|
-
yield effects.put(actions.loadSecurityPolicyLockout());
|
|
3592
|
-
yield effects.put(actions.loadSecurityPolicyCaptcha());
|
|
3593
|
-
}
|
|
3594
|
-
function* loadSecurityPolicyMfaMock() {
|
|
3595
|
-
yield effects.put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
3596
|
-
yield vendor_index.delay();
|
|
3597
|
-
yield effects.put(actions.setSecurityPolicyMfaState({ policy: policyMfaDemo, loading: false }));
|
|
3598
|
-
}
|
|
3599
|
-
function* loadSecurityPolicyVendorMfaMock() {
|
|
3600
|
-
yield effects.put(actions.setSecurityPolicyVendorMfaState({ loading: true, error: null }));
|
|
3601
|
-
yield vendor_index.delay();
|
|
3602
|
-
yield effects.put(actions.setSecurityPolicyVendorMfaState({ policy: policyMfaDemo, loading: false }));
|
|
3603
|
-
}
|
|
3604
|
-
function* saveSecurityPolicyMfaMock(_a) {
|
|
3605
|
-
var _b;
|
|
3606
|
-
var _c = _a.payload, { callback } = _c, newSecurityPolicy = tslib.__rest(_c, ["callback"]);
|
|
3607
|
-
yield effects.put(actions.setSecurityPolicyMfaState({ saving: true, error: null }));
|
|
3608
|
-
const policy = Object.assign(Object.assign({}, policyLockoutDemo), { id: (_b = newSecurityPolicy.id) !== null && _b !== void 0 ? _b : policyLockoutDemo.id, enforceMFAType: newSecurityPolicy.enforceMFAType });
|
|
3609
|
-
yield vendor_index.delay();
|
|
3610
|
-
yield effects.put(actions.setSecurityPolicyMfaState({ policy, saving: false }));
|
|
3611
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
3612
|
-
}
|
|
3613
|
-
function* loadSecurityPolicyLockoutMock() {
|
|
3614
|
-
yield effects.put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
3615
|
-
yield vendor_index.delay();
|
|
3616
|
-
yield effects.put(actions.setSecurityPolicyLockoutState({ policy: policyLockoutDemo, loading: false }));
|
|
3617
|
-
}
|
|
3618
|
-
function* saveSecurityPolicyLockoutMock(_a) {
|
|
3619
|
-
var _b = _a.payload, { callback } = _b, newSecurityPolicy = tslib.__rest(_b, ["callback"]);
|
|
3620
|
-
yield effects.put(actions.setSecurityPolicyLockoutState({ saving: true, error: null }));
|
|
3621
|
-
yield vendor_index.delay();
|
|
3622
|
-
const policy = Object.assign(Object.assign(Object.assign({}, newSecurityPolicy), policyLockoutDemo), { id: newSecurityPolicy.id ? newSecurityPolicy.id : policyLockoutDemo.id });
|
|
3623
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
3624
|
-
yield effects.put(actions.setSecurityPolicyLockoutState({ policy, saving: false }));
|
|
3625
|
-
}
|
|
3626
|
-
function* loadSecurityPolicyCaptchaMock() {
|
|
3627
|
-
yield effects.put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
3628
|
-
yield vendor_index.delay();
|
|
3629
|
-
yield effects.put(actions.setSecurityPolicyLockoutState({ policy: policyLockoutDemo, loading: false }));
|
|
3630
|
-
}
|
|
3631
|
-
function* loadSecurityPolicyPasswordHistoryMock() {
|
|
3632
|
-
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ loading: true, error: null }));
|
|
3633
|
-
yield vendor_index.delay();
|
|
3634
|
-
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ policy: policyPasswordHistoryDemo, loading: false }));
|
|
3635
|
-
}
|
|
3636
|
-
function* saveSecurityPolicyPasswordHistoryMock(_a) {
|
|
3637
|
-
var _b = _a.payload, { callback } = _b, newSecurityPolicy = tslib.__rest(_b, ["callback"]);
|
|
3638
|
-
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ saving: true, error: null }));
|
|
3639
|
-
yield vendor_index.delay();
|
|
3640
|
-
const policy = Object.assign(Object.assign(Object.assign({}, newSecurityPolicy), policyPasswordHistoryDemo), { id: newSecurityPolicy.id ? newSecurityPolicy.id : policyPasswordHistoryDemo.id });
|
|
3641
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
3642
|
-
yield effects.put(actions.setSecurityPolicyPasswordHistoryState({ policy, saving: false }));
|
|
3643
|
-
}
|
|
3644
|
-
function* securityPolicySagasMock() {
|
|
3645
|
-
yield effects.takeLeading(actions.loadSecurityPolicy, loadSecurityPolicyMock);
|
|
3646
|
-
yield effects.takeEvery(actions.loadPublicSecurityPolicy, loadPublicSecurityPolicyMock);
|
|
3647
|
-
yield effects.takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfaMock);
|
|
3648
|
-
yield effects.takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfaMock);
|
|
3649
|
-
yield effects.takeEvery(actions.loadSecurityPolicyVendorMfa, loadSecurityPolicyVendorMfaMock);
|
|
3650
|
-
yield effects.takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockoutMock);
|
|
3651
|
-
yield effects.takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockoutMock);
|
|
3652
|
-
yield effects.takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptchaMock);
|
|
3653
|
-
yield effects.takeEvery(actions.saveSecurityPolicyPasswordHistory, saveSecurityPolicyPasswordHistoryMock);
|
|
3654
|
-
yield effects.takeEvery(actions.loadSecurityPolicyPasswordHistory, loadSecurityPolicyPasswordHistoryMock);
|
|
3655
|
-
}
|
|
3656
|
-
|
|
3657
3727
|
function* saveAccountSettings({ payload }) {
|
|
3658
3728
|
var _a, _b;
|
|
3659
3729
|
try {
|