@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
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, delay as delay$1, all,
|
|
5
|
+
import { takeLeading, put, select, call, takeEvery, delay as delay$1, all, 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';
|
|
@@ -103,6 +103,7 @@ var LoginStep;
|
|
|
103
103
|
LoginStep["preLogin"] = "preLogin";
|
|
104
104
|
LoginStep["magicLinkPreLoginSuccess"] = "magicLinkPreLoginSuccess";
|
|
105
105
|
LoginStep["loginWithSmsOtc"] = "loginWithSmsOtc";
|
|
106
|
+
LoginStep["loginWithQuickSmsOtc"] = "loginWithQuickSmsOtc";
|
|
106
107
|
LoginStep["loginWithOtc"] = "loginWithOtc";
|
|
107
108
|
LoginStep["loginWithPassword"] = "loginWithPassword";
|
|
108
109
|
LoginStep["loginWithTwoFactor"] = "loginWithTwoFactor";
|
|
@@ -150,6 +151,9 @@ const actions$g = {
|
|
|
150
151
|
logout: createAction(`${authStoreName}/logout`, (payload) => ({ payload })),
|
|
151
152
|
silentLogout: createAction(`${authStoreName}/silentLogout`, (payload) => ({ payload })),
|
|
152
153
|
checkIfAllowToRememberMfaDevice: createAction(`${authStoreName}/checkIfAllowToRememberMfaDevice`, (payload) => ({ payload })),
|
|
154
|
+
changePhoneNumberWithVerification: createAction(`${authStoreName}/changePhoneNumberWithVerification`, (payload) => ({ payload })),
|
|
155
|
+
verifyChangePhoneNumber: createAction(`${authStoreName}/verifyChangePhoneNumber`, (payload) => ({ payload })),
|
|
156
|
+
quickSmsPasswordlessPreLogin: createAction(`${authStoreName}/quickSmsPasswordlessPreLogin`, (payload) => ({ payload })),
|
|
153
157
|
passwordlessPreLogin: createAction(`${authStoreName}/passwordlessPreLogin`, (payload) => ({ payload })),
|
|
154
158
|
passwordlessPostLogin: createAction(`${authStoreName}/passwordlessPostLogin`, (payload) => ({ payload })),
|
|
155
159
|
verifyInviteToken: createAction(`${authStoreName}/verifyInviteToken`, (payload) => ({ payload })),
|
|
@@ -394,6 +398,7 @@ const actions$8 = {
|
|
|
394
398
|
lockUser: createAction(`${authStoreName}/lockUser`, (payload) => ({ payload })),
|
|
395
399
|
resendActivationLink: createAction(`${authStoreName}/resendActivationLink`, (payload) => ({ payload })),
|
|
396
400
|
resendInvitationLink: createAction(`${authStoreName}/resendInvitationLink`, (payload) => ({ payload })),
|
|
401
|
+
resendInvitationLinkToAllSubTenants: createAction(`${authStoreName}/resendInvitationLinkToAllSubTenants`, (payload) => ({ payload })),
|
|
397
402
|
getInvitationLink: createAction(`${authStoreName}/getInvitationLink`),
|
|
398
403
|
createInvitationLink: createAction(`${authStoreName}/createInvitationLink`, (payload) => ({ payload })),
|
|
399
404
|
updateInvitationLink: createAction(`${authStoreName}/updateInvitationLink`, (payload) => ({ payload })),
|
|
@@ -755,9 +760,9 @@ const userProfileDemo = {
|
|
|
755
760
|
phoneNumber: '+972-54123456',
|
|
756
761
|
jobTitle: 'Developer',
|
|
757
762
|
address: {
|
|
758
|
-
city:
|
|
759
|
-
country:
|
|
760
|
-
}
|
|
763
|
+
city: 'Tel Aviv',
|
|
764
|
+
country: 'Israel',
|
|
765
|
+
},
|
|
761
766
|
}),
|
|
762
767
|
roleIds: undefined,
|
|
763
768
|
verified: undefined,
|
|
@@ -914,7 +919,6 @@ const userTeamDemo = {
|
|
|
914
919
|
const userSubTenantDemo = {
|
|
915
920
|
metadata: '',
|
|
916
921
|
mfaEnrolled: false,
|
|
917
|
-
permissions: [],
|
|
918
922
|
provider: '',
|
|
919
923
|
sub: '',
|
|
920
924
|
tenantIds: [],
|
|
@@ -924,10 +928,7 @@ const userSubTenantDemo = {
|
|
|
924
928
|
email: 'email',
|
|
925
929
|
name: 'name',
|
|
926
930
|
tenantId: 'tenantId',
|
|
927
|
-
activatedForTenant: true,
|
|
928
931
|
createdAt: new Date(),
|
|
929
|
-
lastLogin: new Date(),
|
|
930
|
-
roles: [],
|
|
931
932
|
};
|
|
932
933
|
const usersDemo = [userTeamDemo, userTeamDemo2];
|
|
933
934
|
const allUsersDemo = [userSubTenantDemo];
|
|
@@ -1040,6 +1041,238 @@ function* signUpSaga() {
|
|
|
1040
1041
|
yield takeLeading(actions.resetSignUpStateSoft, resetSignUpStateSoft);
|
|
1041
1042
|
}
|
|
1042
1043
|
|
|
1044
|
+
function* loadSecurityPolicy() {
|
|
1045
|
+
yield put(actions.setSecurityPolicyGlobalState({ loading: true, error: null }));
|
|
1046
|
+
try {
|
|
1047
|
+
const policy = yield call(api.auth.getGlobalSecurityPolicy);
|
|
1048
|
+
yield put(actions.setSecurityPolicyGlobalState({ policy, loading: false }));
|
|
1049
|
+
}
|
|
1050
|
+
catch (e) {
|
|
1051
|
+
yield put(actions.setSecurityPolicyGlobalState({ error: e.message, loading: false }));
|
|
1052
|
+
}
|
|
1053
|
+
yield put(actions.loadSecurityPolicyMfa());
|
|
1054
|
+
yield put(actions.loadSecurityPolicyVendorMfa());
|
|
1055
|
+
yield put(actions.loadSecurityPolicyLockout());
|
|
1056
|
+
yield put(actions.loadSecurityPolicyCaptcha());
|
|
1057
|
+
yield put(actions.loadPublicAuthStrategiesPolicy());
|
|
1058
|
+
}
|
|
1059
|
+
function* loadPublicSecurityPolicy() {
|
|
1060
|
+
yield put(actions.setSecurityPolicyPublicState({ loading: true, error: null }));
|
|
1061
|
+
try {
|
|
1062
|
+
const policy = yield call(api.auth.getVendorConfig);
|
|
1063
|
+
yield put(actions.setSecurityPolicyPublicState({ policy, loading: false }));
|
|
1064
|
+
}
|
|
1065
|
+
catch (e) {
|
|
1066
|
+
yield put(actions.setSecurityPolicyPublicState({ error: e.message, loading: false }));
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
function* loadPublicAuthStrategiesPolicy() {
|
|
1070
|
+
yield put(actions.setSecurityPolicyAuthStrategyPublicState({ loading: true, error: null }));
|
|
1071
|
+
try {
|
|
1072
|
+
const policy = yield call(api.auth.getVendorPublicAuthStrategiesConfig);
|
|
1073
|
+
yield put(actions.setSecurityPolicyAuthStrategyPublicState({ policy, loading: false }));
|
|
1074
|
+
}
|
|
1075
|
+
catch (e) {
|
|
1076
|
+
yield put(actions.setSecurityPolicyAuthStrategyPublicState({ error: e.message, loading: false }));
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
function* loadSecurityPolicyMfa() {
|
|
1080
|
+
yield put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
1081
|
+
try {
|
|
1082
|
+
const policy = yield call(api.auth.getMfaPolicy);
|
|
1083
|
+
yield put(actions.setSecurityPolicyMfaState({ policy, loading: false }));
|
|
1084
|
+
}
|
|
1085
|
+
catch (e) {
|
|
1086
|
+
yield put(actions.setSecurityPolicyMfaState({ error: e.message, loading: false }));
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
function* loadSecurityPolicyVendorMfa() {
|
|
1090
|
+
yield put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
1091
|
+
try {
|
|
1092
|
+
const policy = yield call(api.auth.getVendorMfaPolicy);
|
|
1093
|
+
yield put(actions.setSecurityPolicyVendorMfaState({ policy, loading: false }));
|
|
1094
|
+
}
|
|
1095
|
+
catch (e) {
|
|
1096
|
+
yield put(actions.setSecurityPolicyVendorMfaState({ error: e.message, loading: false }));
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
function* saveSecurityPolicyMfa(_a) {
|
|
1100
|
+
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
1101
|
+
yield put(actions.setSecurityPolicyMfaState({ saving: true, error: null }));
|
|
1102
|
+
try {
|
|
1103
|
+
const policy = yield call(api.auth.saveMfaPolicy, newSecurityPolicy);
|
|
1104
|
+
yield put(actions.setSecurityPolicyMfaState({ policy, saving: false }));
|
|
1105
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
1106
|
+
}
|
|
1107
|
+
catch (e) {
|
|
1108
|
+
yield put(actions.setSecurityPolicyMfaState({ saving: false, error: e.message }));
|
|
1109
|
+
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
function* loadSecurityPolicyLockout() {
|
|
1113
|
+
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
1114
|
+
try {
|
|
1115
|
+
const policy = yield call(api.auth.getLockoutPolicy);
|
|
1116
|
+
yield put(actions.setSecurityPolicyLockoutState({ policy, loading: false }));
|
|
1117
|
+
}
|
|
1118
|
+
catch (e) {
|
|
1119
|
+
yield put(actions.setSecurityPolicyLockoutState({ error: e.message, loading: false }));
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
function* saveSecurityPolicyLockout(_a) {
|
|
1123
|
+
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
1124
|
+
yield put(actions.setSecurityPolicyLockoutState({ saving: true, error: null }));
|
|
1125
|
+
try {
|
|
1126
|
+
const policy = yield call(api.auth.saveLockoutPolicy, newSecurityPolicy);
|
|
1127
|
+
yield put(actions.setSecurityPolicyLockoutState({ policy, saving: false }));
|
|
1128
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
1129
|
+
}
|
|
1130
|
+
catch (e) {
|
|
1131
|
+
yield put(actions.setSecurityPolicyLockoutState({ saving: false, error: e.message }));
|
|
1132
|
+
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
function* loadSecurityPolicyCaptcha() {
|
|
1136
|
+
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
1137
|
+
try {
|
|
1138
|
+
const policy = yield call(api.auth.getCaptchaPolicy);
|
|
1139
|
+
yield put(actions.setSecurityPolicyCaptchaState({ policy, loading: false }));
|
|
1140
|
+
}
|
|
1141
|
+
catch (e) {
|
|
1142
|
+
yield put(actions.setSecurityPolicyCaptchaState({ error: e.message, loading: false }));
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
function* loadSecurityPolicyPasswordHistory() {
|
|
1146
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ loading: true, error: null }));
|
|
1147
|
+
try {
|
|
1148
|
+
const policy = yield call(api.auth.getPasswordHistoryPolicy);
|
|
1149
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy, loading: false }));
|
|
1150
|
+
}
|
|
1151
|
+
catch (e) {
|
|
1152
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ error: e.message, loading: false }));
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
function* saveSecurityPolicyPasswordHistory(_a) {
|
|
1156
|
+
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
1157
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ saving: true, error: null }));
|
|
1158
|
+
try {
|
|
1159
|
+
const policy = yield call(api.auth.savePasswordHistoryPolicy, newSecurityPolicy);
|
|
1160
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy, saving: false }));
|
|
1161
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
1162
|
+
}
|
|
1163
|
+
catch (e) {
|
|
1164
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ saving: false, error: e.message }));
|
|
1165
|
+
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
function* loadVendorPasswordConfig() {
|
|
1169
|
+
yield put(actions.setSecurityPolicyPasswordState({ loading: true, error: null }));
|
|
1170
|
+
try {
|
|
1171
|
+
const policy = yield call(api.auth.getPasswordConfigPolicy);
|
|
1172
|
+
yield put(actions.setSecurityPolicyPasswordState({ policy, loading: false }));
|
|
1173
|
+
}
|
|
1174
|
+
catch (e) {
|
|
1175
|
+
yield put(actions.setSecurityPolicyPasswordState({ error: e.message, loading: false }));
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
function* securityPolicySagas() {
|
|
1179
|
+
yield takeLeading(actions.loadSecurityPolicy, loadSecurityPolicy);
|
|
1180
|
+
yield takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfa);
|
|
1181
|
+
yield takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfa);
|
|
1182
|
+
yield takeEvery(actions.loadSecurityPolicyVendorMfa, loadSecurityPolicyVendorMfa);
|
|
1183
|
+
yield takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockout);
|
|
1184
|
+
yield takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockout);
|
|
1185
|
+
yield takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptcha);
|
|
1186
|
+
yield takeEvery(actions.saveSecurityPolicyPasswordHistory, saveSecurityPolicyPasswordHistory);
|
|
1187
|
+
yield takeEvery(actions.loadSecurityPolicyPasswordHistory, loadSecurityPolicyPasswordHistory);
|
|
1188
|
+
yield takeEvery(actions.loadVendorPasswordConfig, loadVendorPasswordConfig);
|
|
1189
|
+
yield takeEvery(actions.loadPublicSecurityPolicy, loadPublicSecurityPolicy);
|
|
1190
|
+
yield takeEvery(actions.loadPublicAuthStrategiesPolicy, loadPublicAuthStrategiesPolicy);
|
|
1191
|
+
}
|
|
1192
|
+
/*********************************
|
|
1193
|
+
* Preview Sagas
|
|
1194
|
+
*********************************/
|
|
1195
|
+
function* loadPublicSecurityPolicyMock() {
|
|
1196
|
+
yield put(actions.setSecurityPolicyPublicState({ loading: true, error: null }));
|
|
1197
|
+
try {
|
|
1198
|
+
yield put(actions.setSecurityPolicyPublicState({ policy: publicSecurityPolicy, loading: false }));
|
|
1199
|
+
}
|
|
1200
|
+
catch (e) {
|
|
1201
|
+
yield put(actions.setSecurityPolicyPublicState({ error: e.message, loading: false }));
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
function* loadSecurityPolicyMock() {
|
|
1205
|
+
yield put(actions.setSecurityPolicyGlobalState({ loading: true, error: null }));
|
|
1206
|
+
yield delay();
|
|
1207
|
+
yield put(actions.setSecurityPolicyGlobalState({ policy: policyDemo, loading: false }));
|
|
1208
|
+
yield put(actions.loadSecurityPolicyMfa());
|
|
1209
|
+
yield put(actions.loadSecurityPolicyVendorMfa());
|
|
1210
|
+
yield put(actions.loadSecurityPolicyLockout());
|
|
1211
|
+
yield put(actions.loadSecurityPolicyCaptcha());
|
|
1212
|
+
}
|
|
1213
|
+
function* loadSecurityPolicyMfaMock() {
|
|
1214
|
+
yield put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
1215
|
+
yield delay();
|
|
1216
|
+
yield put(actions.setSecurityPolicyMfaState({ policy: policyMfaDemo, loading: false }));
|
|
1217
|
+
}
|
|
1218
|
+
function* loadSecurityPolicyVendorMfaMock() {
|
|
1219
|
+
yield put(actions.setSecurityPolicyVendorMfaState({ loading: true, error: null }));
|
|
1220
|
+
yield delay();
|
|
1221
|
+
yield put(actions.setSecurityPolicyVendorMfaState({ policy: policyMfaDemo, loading: false }));
|
|
1222
|
+
}
|
|
1223
|
+
function* saveSecurityPolicyMfaMock(_a) {
|
|
1224
|
+
var _b;
|
|
1225
|
+
var _c = _a.payload, { callback } = _c, newSecurityPolicy = __rest(_c, ["callback"]);
|
|
1226
|
+
yield put(actions.setSecurityPolicyMfaState({ saving: true, error: null }));
|
|
1227
|
+
const policy = Object.assign(Object.assign({}, policyLockoutDemo), { id: (_b = newSecurityPolicy.id) !== null && _b !== void 0 ? _b : policyLockoutDemo.id, enforceMFAType: newSecurityPolicy.enforceMFAType });
|
|
1228
|
+
yield delay();
|
|
1229
|
+
yield put(actions.setSecurityPolicyMfaState({ policy, saving: false }));
|
|
1230
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
1231
|
+
}
|
|
1232
|
+
function* loadSecurityPolicyLockoutMock() {
|
|
1233
|
+
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
1234
|
+
yield delay();
|
|
1235
|
+
yield put(actions.setSecurityPolicyLockoutState({ policy: policyLockoutDemo, loading: false }));
|
|
1236
|
+
}
|
|
1237
|
+
function* saveSecurityPolicyLockoutMock(_a) {
|
|
1238
|
+
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
1239
|
+
yield put(actions.setSecurityPolicyLockoutState({ saving: true, error: null }));
|
|
1240
|
+
yield delay();
|
|
1241
|
+
const policy = Object.assign(Object.assign(Object.assign({}, newSecurityPolicy), policyLockoutDemo), { id: newSecurityPolicy.id ? newSecurityPolicy.id : policyLockoutDemo.id });
|
|
1242
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
1243
|
+
yield put(actions.setSecurityPolicyLockoutState({ policy, saving: false }));
|
|
1244
|
+
}
|
|
1245
|
+
function* loadSecurityPolicyCaptchaMock() {
|
|
1246
|
+
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
1247
|
+
yield delay();
|
|
1248
|
+
yield put(actions.setSecurityPolicyLockoutState({ policy: policyLockoutDemo, loading: false }));
|
|
1249
|
+
}
|
|
1250
|
+
function* loadSecurityPolicyPasswordHistoryMock() {
|
|
1251
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ loading: true, error: null }));
|
|
1252
|
+
yield delay();
|
|
1253
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy: policyPasswordHistoryDemo, loading: false }));
|
|
1254
|
+
}
|
|
1255
|
+
function* saveSecurityPolicyPasswordHistoryMock(_a) {
|
|
1256
|
+
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
1257
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ saving: true, error: null }));
|
|
1258
|
+
yield delay();
|
|
1259
|
+
const policy = Object.assign(Object.assign(Object.assign({}, newSecurityPolicy), policyPasswordHistoryDemo), { id: newSecurityPolicy.id ? newSecurityPolicy.id : policyPasswordHistoryDemo.id });
|
|
1260
|
+
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
1261
|
+
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy, saving: false }));
|
|
1262
|
+
}
|
|
1263
|
+
function* securityPolicySagasMock() {
|
|
1264
|
+
yield takeLeading(actions.loadSecurityPolicy, loadSecurityPolicyMock);
|
|
1265
|
+
yield takeEvery(actions.loadPublicSecurityPolicy, loadPublicSecurityPolicyMock);
|
|
1266
|
+
yield takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfaMock);
|
|
1267
|
+
yield takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfaMock);
|
|
1268
|
+
yield takeEvery(actions.loadSecurityPolicyVendorMfa, loadSecurityPolicyVendorMfaMock);
|
|
1269
|
+
yield takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockoutMock);
|
|
1270
|
+
yield takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockoutMock);
|
|
1271
|
+
yield takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptchaMock);
|
|
1272
|
+
yield takeEvery(actions.saveSecurityPolicyPasswordHistory, saveSecurityPolicyPasswordHistoryMock);
|
|
1273
|
+
yield takeEvery(actions.loadSecurityPolicyPasswordHistory, loadSecurityPolicyPasswordHistoryMock);
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1043
1276
|
const authStrategyLoginStepMap = {
|
|
1044
1277
|
[AuthStrategyEnum.Code]: LoginStep.loginWithOtc,
|
|
1045
1278
|
[AuthStrategyEnum.EmailAndPassword]: LoginStep.loginWithPassword,
|
|
@@ -1170,6 +1403,7 @@ function* requestAuthorize({ payload: firstTime }) {
|
|
|
1170
1403
|
yield put(actions.setState({ isLoading: true }));
|
|
1171
1404
|
yield put(actions.loadSocialLoginsConfigurationV2());
|
|
1172
1405
|
calls.push(call(loadAllowSignUps));
|
|
1406
|
+
calls.push(call(loadPublicAuthStrategiesPolicy));
|
|
1173
1407
|
calls.push(call(loadSSOPublicConfigurationFunction));
|
|
1174
1408
|
calls.push(call(loadVendorPublicInfo));
|
|
1175
1409
|
calls.push(call(refreshMetadata));
|
|
@@ -1263,6 +1497,48 @@ function* handleHostedLoginCallback({ payload }) {
|
|
|
1263
1497
|
yield put(actions.loadTenants());
|
|
1264
1498
|
yield afterAuthNavigation();
|
|
1265
1499
|
}
|
|
1500
|
+
function* changePhoneNumberWithVerification(_a) {
|
|
1501
|
+
var _b = _a.payload, { callback } = _b, payload = __rest(_b, ["callback"]);
|
|
1502
|
+
try {
|
|
1503
|
+
yield put(actions.setLoginState({ loading: true }));
|
|
1504
|
+
const changePhoneRes = yield call(api.auth.changePhoneNumberWithVerification, payload);
|
|
1505
|
+
yield put(actions.setLoginState({ phoneNumber: payload.phoneNumber, loading: false, changePhoneId: changePhoneRes.changePhoneId, step: LoginStep.loginWithQuickSmsOtc, error: undefined }));
|
|
1506
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1507
|
+
}
|
|
1508
|
+
catch (e) {
|
|
1509
|
+
yield put(actions.setLoginState({ error: e.message, loading: false }));
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
function* verifyChangePhoneNumber(_a) {
|
|
1513
|
+
var _b = _a.payload, { callback } = _b, payload = __rest(_b, ["callback"]);
|
|
1514
|
+
try {
|
|
1515
|
+
yield put(actions.setLoginState({ loading: true }));
|
|
1516
|
+
yield call(api.auth.verifyChangePhoneNumber, payload);
|
|
1517
|
+
yield put(actions.setLoginState({ loading: false }));
|
|
1518
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1519
|
+
}
|
|
1520
|
+
catch (e) {
|
|
1521
|
+
yield put(actions.setLoginState({ error: e.message, loading: false }));
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
function* quickSmsPasswordlessPreLogin(_a) {
|
|
1525
|
+
var _b = _a.payload, { callback } = _b, payload = __rest(_b, ["callback"]);
|
|
1526
|
+
try {
|
|
1527
|
+
yield put(actions.setLoginState({ loading: true }));
|
|
1528
|
+
const preloginRes = yield call(api.auth.passwordlessPreLogin, Object.assign(Object.assign({}, payload), { type: AuthStrategyEnum.SmsCode }));
|
|
1529
|
+
yield put(actions.setLoginState({
|
|
1530
|
+
step: LoginStep.loginWithQuickSmsOtc,
|
|
1531
|
+
loading: false,
|
|
1532
|
+
email: payload.email,
|
|
1533
|
+
phoneNumber: preloginRes === null || preloginRes === void 0 ? void 0 : preloginRes.phoneNumber,
|
|
1534
|
+
}));
|
|
1535
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
1536
|
+
}
|
|
1537
|
+
catch (e) {
|
|
1538
|
+
yield put(actions.setLoginState({ error: e.message, loading: false }));
|
|
1539
|
+
callback === null || callback === void 0 ? void 0 : callback(e);
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1266
1542
|
function* passwordlessPreLogin(_a) {
|
|
1267
1543
|
var _b = _a.payload, { callback } = _b, payload = __rest(_b, ["callback"]);
|
|
1268
1544
|
try {
|
|
@@ -1638,6 +1914,9 @@ function* loginSagas() {
|
|
|
1638
1914
|
yield takeLeading(actions.silentLogout, silentLogout);
|
|
1639
1915
|
yield takeLeading(actions.loginWithMfa, loginWithMfa);
|
|
1640
1916
|
yield takeLeading(actions.recoverMfa, recoverMfa);
|
|
1917
|
+
yield takeLeading(actions.quickSmsPasswordlessPreLogin, quickSmsPasswordlessPreLogin);
|
|
1918
|
+
yield takeLeading(actions.changePhoneNumberWithVerification, changePhoneNumberWithVerification);
|
|
1919
|
+
yield takeLeading(actions.verifyChangePhoneNumber, verifyChangePhoneNumber);
|
|
1641
1920
|
yield takeLeading(actions.passwordlessPreLogin, passwordlessPreLogin);
|
|
1642
1921
|
yield takeLeading(actions.passwordlessPostLogin, passwordlessPostLogin);
|
|
1643
1922
|
yield takeLeading(actions.verifyInviteToken, verifyInviteToken);
|
|
@@ -2865,8 +3144,9 @@ function* setUserRolesForSubTenants({ payload, }) {
|
|
|
2865
3144
|
try {
|
|
2866
3145
|
yield call(api.subTenants.setUserRolesForSubTenants, userId, body);
|
|
2867
3146
|
const updatedUser = teamState.allUsers.find((user) => user.id === userId);
|
|
3147
|
+
let newTenants = [];
|
|
2868
3148
|
if (updatedUser) {
|
|
2869
|
-
|
|
3149
|
+
newTenants = updatedUser.tenants.map((tenant) => {
|
|
2870
3150
|
var _a;
|
|
2871
3151
|
return (Object.assign(Object.assign({}, tenant), { roles: ((_a = body.subTenantsRoles
|
|
2872
3152
|
.find((roleUpdate) => roleUpdate.tenantId === tenant.tenantId)) === null || _a === void 0 ? void 0 : _a.roleIds.map((roleId) => {
|
|
@@ -2878,7 +3158,7 @@ function* setUserRolesForSubTenants({ payload, }) {
|
|
|
2878
3158
|
yield put(actions.setTeamState({
|
|
2879
3159
|
allUsers: [
|
|
2880
3160
|
...teamState.allUsers.filter((user) => user.id !== userId),
|
|
2881
|
-
...(updatedUser ? [updatedUser] : []),
|
|
3161
|
+
...(updatedUser ? [Object.assign(Object.assign({}, updatedUser), { tenants: newTenants })] : []),
|
|
2882
3162
|
],
|
|
2883
3163
|
addUserDialogState: { open: false, loading: false },
|
|
2884
3164
|
}));
|
|
@@ -2936,6 +3216,19 @@ function* resendInvitationLink({ payload }) {
|
|
|
2936
3216
|
}
|
|
2937
3217
|
yield put(actions.setTeamLoader({ key: TeamStateKeys.RESEND_INVITATION_LINK, value: false }));
|
|
2938
3218
|
}
|
|
3219
|
+
function* resendInvitationLinkToAllSubTenants({ payload, }) {
|
|
3220
|
+
const { callback } = payload, body = __rest(payload, ["callback"]);
|
|
3221
|
+
yield put(actions.setTeamLoader({ key: TeamStateKeys.RESEND_INVITATION_LINK, value: body.email }));
|
|
3222
|
+
try {
|
|
3223
|
+
yield call(api.teams.resendInvitationLinkToAllTenants, body);
|
|
3224
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
3225
|
+
}
|
|
3226
|
+
catch (e) {
|
|
3227
|
+
yield put(actions.setTeamError({ key: TeamStateKeys.RESEND_INVITATION_LINK, value: e.message }));
|
|
3228
|
+
callback === null || callback === void 0 ? void 0 : callback(null, e.message);
|
|
3229
|
+
}
|
|
3230
|
+
yield put(actions.setTeamLoader({ key: TeamStateKeys.RESEND_INVITATION_LINK, value: false }));
|
|
3231
|
+
}
|
|
2939
3232
|
function* getInvitationLinkConfig() {
|
|
2940
3233
|
yield put(actions.setTeamError({ key: TeamStateKeys.CONFIG_TOKEN_LINK, value: false }));
|
|
2941
3234
|
try {
|
|
@@ -3043,6 +3336,7 @@ function* teamSagas() {
|
|
|
3043
3336
|
yield takeEvery(actions.deleteUserFromSubTenants, deleteUserFromSubTenants);
|
|
3044
3337
|
yield takeEvery(actions.resendActivationLink, resendActivationLink);
|
|
3045
3338
|
yield takeEvery(actions.resendInvitationLink, resendInvitationLink);
|
|
3339
|
+
yield takeEvery(actions.resendInvitationLinkToAllSubTenants, resendInvitationLinkToAllSubTenants);
|
|
3046
3340
|
yield takeEvery(actions.getInvitationLink, getInvitationLink);
|
|
3047
3341
|
yield takeEvery(actions.createInvitationLink, createInvitationLink);
|
|
3048
3342
|
yield takeEvery(actions.updateInvitationLink, updateInvitationLink);
|
|
@@ -3206,6 +3500,13 @@ function* resendInvitationLinkMock({ payload }) {
|
|
|
3206
3500
|
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
3207
3501
|
yield put(actions.setTeamLoader({ key: TeamStateKeys.RESEND_INVITATION_LINK, value: false }));
|
|
3208
3502
|
}
|
|
3503
|
+
function* resendInvitationLinkToAllSubTenantsMock({ payload, }) {
|
|
3504
|
+
const { callback } = payload, body = __rest(payload, ["callback"]);
|
|
3505
|
+
yield put(actions.setTeamLoader({ key: TeamStateKeys.RESEND_INVITATION_LINK, value: body.email }));
|
|
3506
|
+
yield delay();
|
|
3507
|
+
callback === null || callback === void 0 ? void 0 : callback(true);
|
|
3508
|
+
yield put(actions.setTeamLoader({ key: TeamStateKeys.RESEND_INVITATION_LINK, value: false }));
|
|
3509
|
+
}
|
|
3209
3510
|
function* teamSagasMock() {
|
|
3210
3511
|
yield takeLatest(actions.loadUsers, loadUsersMock);
|
|
3211
3512
|
yield takeLatest(actions.loadAllSubTenantsUsers, loadAllSubTenantsUsersMock);
|
|
@@ -3217,6 +3518,7 @@ function* teamSagasMock() {
|
|
|
3217
3518
|
yield takeEvery(actions.deleteUserFromSubTenants, deleteUserFromSubTenantsMock);
|
|
3218
3519
|
yield takeEvery(actions.resendActivationLink, resendActivationLinkMock);
|
|
3219
3520
|
yield takeEvery(actions.resendInvitationLink, resendInvitationLinkMock);
|
|
3521
|
+
yield takeEvery(actions.resendInvitationLinkToAllSubTenants, resendInvitationLinkToAllSubTenantsMock);
|
|
3220
3522
|
yield takeEvery(actions.openAddUserDialog, openAddUserDialog);
|
|
3221
3523
|
yield takeEvery(actions.closeAddUserDialog, closeAddUserDialog);
|
|
3222
3524
|
yield takeEvery(actions.openDeleteUserDialog, openDeleteUserDialog);
|
|
@@ -3503,238 +3805,6 @@ function* apiTokensSagaMock() {
|
|
|
3503
3805
|
yield takeLatest(actions.deleteTenantApiToken, deleteTenantApiTokenMock);
|
|
3504
3806
|
}
|
|
3505
3807
|
|
|
3506
|
-
function* loadSecurityPolicy() {
|
|
3507
|
-
yield put(actions.setSecurityPolicyGlobalState({ loading: true, error: null }));
|
|
3508
|
-
try {
|
|
3509
|
-
const policy = yield call(api.auth.getGlobalSecurityPolicy);
|
|
3510
|
-
yield put(actions.setSecurityPolicyGlobalState({ policy, loading: false }));
|
|
3511
|
-
}
|
|
3512
|
-
catch (e) {
|
|
3513
|
-
yield put(actions.setSecurityPolicyGlobalState({ error: e.message, loading: false }));
|
|
3514
|
-
}
|
|
3515
|
-
yield put(actions.loadSecurityPolicyMfa());
|
|
3516
|
-
yield put(actions.loadSecurityPolicyVendorMfa());
|
|
3517
|
-
yield put(actions.loadSecurityPolicyLockout());
|
|
3518
|
-
yield put(actions.loadSecurityPolicyCaptcha());
|
|
3519
|
-
yield put(actions.loadPublicAuthStrategiesPolicy());
|
|
3520
|
-
}
|
|
3521
|
-
function* loadPublicSecurityPolicy() {
|
|
3522
|
-
yield put(actions.setSecurityPolicyPublicState({ loading: true, error: null }));
|
|
3523
|
-
try {
|
|
3524
|
-
const policy = yield call(api.auth.getVendorConfig);
|
|
3525
|
-
yield put(actions.setSecurityPolicyPublicState({ policy, loading: false }));
|
|
3526
|
-
}
|
|
3527
|
-
catch (e) {
|
|
3528
|
-
yield put(actions.setSecurityPolicyPublicState({ error: e.message, loading: false }));
|
|
3529
|
-
}
|
|
3530
|
-
}
|
|
3531
|
-
function* loadPublicAuthStrategiesPolicy() {
|
|
3532
|
-
yield put(actions.setSecurityPolicyAuthStrategyPublicState({ loading: true, error: null }));
|
|
3533
|
-
try {
|
|
3534
|
-
const policy = yield call(api.auth.getVendorPublicAuthStrategiesConfig);
|
|
3535
|
-
yield put(actions.setSecurityPolicyAuthStrategyPublicState({ policy, loading: false }));
|
|
3536
|
-
}
|
|
3537
|
-
catch (e) {
|
|
3538
|
-
yield put(actions.setSecurityPolicyAuthStrategyPublicState({ error: e.message, loading: false }));
|
|
3539
|
-
}
|
|
3540
|
-
}
|
|
3541
|
-
function* loadSecurityPolicyMfa() {
|
|
3542
|
-
yield put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
3543
|
-
try {
|
|
3544
|
-
const policy = yield call(api.auth.getMfaPolicy);
|
|
3545
|
-
yield put(actions.setSecurityPolicyMfaState({ policy, loading: false }));
|
|
3546
|
-
}
|
|
3547
|
-
catch (e) {
|
|
3548
|
-
yield put(actions.setSecurityPolicyMfaState({ error: e.message, loading: false }));
|
|
3549
|
-
}
|
|
3550
|
-
}
|
|
3551
|
-
function* loadSecurityPolicyVendorMfa() {
|
|
3552
|
-
yield put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
3553
|
-
try {
|
|
3554
|
-
const policy = yield call(api.auth.getVendorMfaPolicy);
|
|
3555
|
-
yield put(actions.setSecurityPolicyVendorMfaState({ policy, loading: false }));
|
|
3556
|
-
}
|
|
3557
|
-
catch (e) {
|
|
3558
|
-
yield put(actions.setSecurityPolicyVendorMfaState({ error: e.message, loading: false }));
|
|
3559
|
-
}
|
|
3560
|
-
}
|
|
3561
|
-
function* saveSecurityPolicyMfa(_a) {
|
|
3562
|
-
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
3563
|
-
yield put(actions.setSecurityPolicyMfaState({ saving: true, error: null }));
|
|
3564
|
-
try {
|
|
3565
|
-
const policy = yield call(api.auth.saveMfaPolicy, newSecurityPolicy);
|
|
3566
|
-
yield put(actions.setSecurityPolicyMfaState({ policy, saving: false }));
|
|
3567
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
3568
|
-
}
|
|
3569
|
-
catch (e) {
|
|
3570
|
-
yield put(actions.setSecurityPolicyMfaState({ saving: false, error: e.message }));
|
|
3571
|
-
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
3572
|
-
}
|
|
3573
|
-
}
|
|
3574
|
-
function* loadSecurityPolicyLockout() {
|
|
3575
|
-
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
3576
|
-
try {
|
|
3577
|
-
const policy = yield call(api.auth.getLockoutPolicy);
|
|
3578
|
-
yield put(actions.setSecurityPolicyLockoutState({ policy, loading: false }));
|
|
3579
|
-
}
|
|
3580
|
-
catch (e) {
|
|
3581
|
-
yield put(actions.setSecurityPolicyLockoutState({ error: e.message, loading: false }));
|
|
3582
|
-
}
|
|
3583
|
-
}
|
|
3584
|
-
function* saveSecurityPolicyLockout(_a) {
|
|
3585
|
-
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
3586
|
-
yield put(actions.setSecurityPolicyLockoutState({ saving: true, error: null }));
|
|
3587
|
-
try {
|
|
3588
|
-
const policy = yield call(api.auth.saveLockoutPolicy, newSecurityPolicy);
|
|
3589
|
-
yield put(actions.setSecurityPolicyLockoutState({ policy, saving: false }));
|
|
3590
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
3591
|
-
}
|
|
3592
|
-
catch (e) {
|
|
3593
|
-
yield put(actions.setSecurityPolicyLockoutState({ saving: false, error: e.message }));
|
|
3594
|
-
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
3595
|
-
}
|
|
3596
|
-
}
|
|
3597
|
-
function* loadSecurityPolicyCaptcha() {
|
|
3598
|
-
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
3599
|
-
try {
|
|
3600
|
-
const policy = yield call(api.auth.getCaptchaPolicy);
|
|
3601
|
-
yield put(actions.setSecurityPolicyCaptchaState({ policy, loading: false }));
|
|
3602
|
-
}
|
|
3603
|
-
catch (e) {
|
|
3604
|
-
yield put(actions.setSecurityPolicyCaptchaState({ error: e.message, loading: false }));
|
|
3605
|
-
}
|
|
3606
|
-
}
|
|
3607
|
-
function* loadSecurityPolicyPasswordHistory() {
|
|
3608
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ loading: true, error: null }));
|
|
3609
|
-
try {
|
|
3610
|
-
const policy = yield call(api.auth.getPasswordHistoryPolicy);
|
|
3611
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy, loading: false }));
|
|
3612
|
-
}
|
|
3613
|
-
catch (e) {
|
|
3614
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ error: e.message, loading: false }));
|
|
3615
|
-
}
|
|
3616
|
-
}
|
|
3617
|
-
function* saveSecurityPolicyPasswordHistory(_a) {
|
|
3618
|
-
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
3619
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ saving: true, error: null }));
|
|
3620
|
-
try {
|
|
3621
|
-
const policy = yield call(api.auth.savePasswordHistoryPolicy, newSecurityPolicy);
|
|
3622
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy, saving: false }));
|
|
3623
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
3624
|
-
}
|
|
3625
|
-
catch (e) {
|
|
3626
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ saving: false, error: e.message }));
|
|
3627
|
-
callback === null || callback === void 0 ? void 0 : callback(null, e);
|
|
3628
|
-
}
|
|
3629
|
-
}
|
|
3630
|
-
function* loadVendorPasswordConfig() {
|
|
3631
|
-
yield put(actions.setSecurityPolicyPasswordState({ loading: true, error: null }));
|
|
3632
|
-
try {
|
|
3633
|
-
const policy = yield call(api.auth.getPasswordConfigPolicy);
|
|
3634
|
-
yield put(actions.setSecurityPolicyPasswordState({ policy, loading: false }));
|
|
3635
|
-
}
|
|
3636
|
-
catch (e) {
|
|
3637
|
-
yield put(actions.setSecurityPolicyPasswordState({ error: e.message, loading: false }));
|
|
3638
|
-
}
|
|
3639
|
-
}
|
|
3640
|
-
function* securityPolicySagas() {
|
|
3641
|
-
yield takeLeading(actions.loadSecurityPolicy, loadSecurityPolicy);
|
|
3642
|
-
yield takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfa);
|
|
3643
|
-
yield takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfa);
|
|
3644
|
-
yield takeEvery(actions.loadSecurityPolicyVendorMfa, loadSecurityPolicyVendorMfa);
|
|
3645
|
-
yield takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockout);
|
|
3646
|
-
yield takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockout);
|
|
3647
|
-
yield takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptcha);
|
|
3648
|
-
yield takeEvery(actions.saveSecurityPolicyPasswordHistory, saveSecurityPolicyPasswordHistory);
|
|
3649
|
-
yield takeEvery(actions.loadSecurityPolicyPasswordHistory, loadSecurityPolicyPasswordHistory);
|
|
3650
|
-
yield takeEvery(actions.loadVendorPasswordConfig, loadVendorPasswordConfig);
|
|
3651
|
-
yield takeEvery(actions.loadPublicSecurityPolicy, loadPublicSecurityPolicy);
|
|
3652
|
-
yield takeEvery(actions.loadPublicAuthStrategiesPolicy, loadPublicAuthStrategiesPolicy);
|
|
3653
|
-
}
|
|
3654
|
-
/*********************************
|
|
3655
|
-
* Preview Sagas
|
|
3656
|
-
*********************************/
|
|
3657
|
-
function* loadPublicSecurityPolicyMock() {
|
|
3658
|
-
yield put(actions.setSecurityPolicyPublicState({ loading: true, error: null }));
|
|
3659
|
-
try {
|
|
3660
|
-
yield put(actions.setSecurityPolicyPublicState({ policy: publicSecurityPolicy, loading: false }));
|
|
3661
|
-
}
|
|
3662
|
-
catch (e) {
|
|
3663
|
-
yield put(actions.setSecurityPolicyPublicState({ error: e.message, loading: false }));
|
|
3664
|
-
}
|
|
3665
|
-
}
|
|
3666
|
-
function* loadSecurityPolicyMock() {
|
|
3667
|
-
yield put(actions.setSecurityPolicyGlobalState({ loading: true, error: null }));
|
|
3668
|
-
yield delay();
|
|
3669
|
-
yield put(actions.setSecurityPolicyGlobalState({ policy: policyDemo, loading: false }));
|
|
3670
|
-
yield put(actions.loadSecurityPolicyMfa());
|
|
3671
|
-
yield put(actions.loadSecurityPolicyVendorMfa());
|
|
3672
|
-
yield put(actions.loadSecurityPolicyLockout());
|
|
3673
|
-
yield put(actions.loadSecurityPolicyCaptcha());
|
|
3674
|
-
}
|
|
3675
|
-
function* loadSecurityPolicyMfaMock() {
|
|
3676
|
-
yield put(actions.setSecurityPolicyMfaState({ loading: true, error: null }));
|
|
3677
|
-
yield delay();
|
|
3678
|
-
yield put(actions.setSecurityPolicyMfaState({ policy: policyMfaDemo, loading: false }));
|
|
3679
|
-
}
|
|
3680
|
-
function* loadSecurityPolicyVendorMfaMock() {
|
|
3681
|
-
yield put(actions.setSecurityPolicyVendorMfaState({ loading: true, error: null }));
|
|
3682
|
-
yield delay();
|
|
3683
|
-
yield put(actions.setSecurityPolicyVendorMfaState({ policy: policyMfaDemo, loading: false }));
|
|
3684
|
-
}
|
|
3685
|
-
function* saveSecurityPolicyMfaMock(_a) {
|
|
3686
|
-
var _b;
|
|
3687
|
-
var _c = _a.payload, { callback } = _c, newSecurityPolicy = __rest(_c, ["callback"]);
|
|
3688
|
-
yield put(actions.setSecurityPolicyMfaState({ saving: true, error: null }));
|
|
3689
|
-
const policy = Object.assign(Object.assign({}, policyLockoutDemo), { id: (_b = newSecurityPolicy.id) !== null && _b !== void 0 ? _b : policyLockoutDemo.id, enforceMFAType: newSecurityPolicy.enforceMFAType });
|
|
3690
|
-
yield delay();
|
|
3691
|
-
yield put(actions.setSecurityPolicyMfaState({ policy, saving: false }));
|
|
3692
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
3693
|
-
}
|
|
3694
|
-
function* loadSecurityPolicyLockoutMock() {
|
|
3695
|
-
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
3696
|
-
yield delay();
|
|
3697
|
-
yield put(actions.setSecurityPolicyLockoutState({ policy: policyLockoutDemo, loading: false }));
|
|
3698
|
-
}
|
|
3699
|
-
function* saveSecurityPolicyLockoutMock(_a) {
|
|
3700
|
-
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
3701
|
-
yield put(actions.setSecurityPolicyLockoutState({ saving: true, error: null }));
|
|
3702
|
-
yield delay();
|
|
3703
|
-
const policy = Object.assign(Object.assign(Object.assign({}, newSecurityPolicy), policyLockoutDemo), { id: newSecurityPolicy.id ? newSecurityPolicy.id : policyLockoutDemo.id });
|
|
3704
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
3705
|
-
yield put(actions.setSecurityPolicyLockoutState({ policy, saving: false }));
|
|
3706
|
-
}
|
|
3707
|
-
function* loadSecurityPolicyCaptchaMock() {
|
|
3708
|
-
yield put(actions.setSecurityPolicyLockoutState({ loading: true, error: null }));
|
|
3709
|
-
yield delay();
|
|
3710
|
-
yield put(actions.setSecurityPolicyLockoutState({ policy: policyLockoutDemo, loading: false }));
|
|
3711
|
-
}
|
|
3712
|
-
function* loadSecurityPolicyPasswordHistoryMock() {
|
|
3713
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ loading: true, error: null }));
|
|
3714
|
-
yield delay();
|
|
3715
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy: policyPasswordHistoryDemo, loading: false }));
|
|
3716
|
-
}
|
|
3717
|
-
function* saveSecurityPolicyPasswordHistoryMock(_a) {
|
|
3718
|
-
var _b = _a.payload, { callback } = _b, newSecurityPolicy = __rest(_b, ["callback"]);
|
|
3719
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ saving: true, error: null }));
|
|
3720
|
-
yield delay();
|
|
3721
|
-
const policy = Object.assign(Object.assign(Object.assign({}, newSecurityPolicy), policyPasswordHistoryDemo), { id: newSecurityPolicy.id ? newSecurityPolicy.id : policyPasswordHistoryDemo.id });
|
|
3722
|
-
callback === null || callback === void 0 ? void 0 : callback(policy);
|
|
3723
|
-
yield put(actions.setSecurityPolicyPasswordHistoryState({ policy, saving: false }));
|
|
3724
|
-
}
|
|
3725
|
-
function* securityPolicySagasMock() {
|
|
3726
|
-
yield takeLeading(actions.loadSecurityPolicy, loadSecurityPolicyMock);
|
|
3727
|
-
yield takeEvery(actions.loadPublicSecurityPolicy, loadPublicSecurityPolicyMock);
|
|
3728
|
-
yield takeEvery(actions.saveSecurityPolicyMfa, saveSecurityPolicyMfaMock);
|
|
3729
|
-
yield takeEvery(actions.loadSecurityPolicyMfa, loadSecurityPolicyMfaMock);
|
|
3730
|
-
yield takeEvery(actions.loadSecurityPolicyVendorMfa, loadSecurityPolicyVendorMfaMock);
|
|
3731
|
-
yield takeEvery(actions.saveSecurityPolicyLockout, saveSecurityPolicyLockoutMock);
|
|
3732
|
-
yield takeEvery(actions.loadSecurityPolicyLockout, loadSecurityPolicyLockoutMock);
|
|
3733
|
-
yield takeEvery(actions.loadSecurityPolicyCaptcha, loadSecurityPolicyCaptchaMock);
|
|
3734
|
-
yield takeEvery(actions.saveSecurityPolicyPasswordHistory, saveSecurityPolicyPasswordHistoryMock);
|
|
3735
|
-
yield takeEvery(actions.loadSecurityPolicyPasswordHistory, loadSecurityPolicyPasswordHistoryMock);
|
|
3736
|
-
}
|
|
3737
|
-
|
|
3738
3808
|
function* saveAccountSettings({ payload }) {
|
|
3739
3809
|
var _a, _b;
|
|
3740
3810
|
try {
|