@frontegg/redux-store 7.31.0-alpha.4 → 7.31.0-alpha.6
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/actions/index.js +18 -18
- package/index.js +1 -1
- package/node/auth/LoginState/actions/index.js +18 -18
- package/node/index.js +1 -1
- package/package.json +2 -2
|
@@ -244,7 +244,7 @@ export default ((store, api, sharedActions) => {
|
|
|
244
244
|
routes
|
|
245
245
|
} = store.auth;
|
|
246
246
|
if (isMfaRequired(user, store.root.appName)) {
|
|
247
|
-
const mfaRequiredState = await actions.getMfaRequiredState(user);
|
|
247
|
+
const mfaRequiredState = await actions.getMfaRequiredState(user, DEFAULT_RETRY_CONFIG, true);
|
|
248
248
|
actions.setAuthState(mfaRequiredState);
|
|
249
249
|
onRedirectTo(routes.loginUrl, {
|
|
250
250
|
preserveQueryParams: true
|
|
@@ -257,23 +257,23 @@ export default ((store, api, sharedActions) => {
|
|
|
257
257
|
const resetLoginState = () => {
|
|
258
258
|
deepResetState(store, ['auth', 'loginState'], initialState);
|
|
259
259
|
};
|
|
260
|
+
const getRetryWithBlockingCallbackPayload = requestName => {
|
|
261
|
+
const callback = (_, error) => {
|
|
262
|
+
if (!error) return;
|
|
263
|
+
actions.setErrorByRequestName({
|
|
264
|
+
requestName,
|
|
265
|
+
traceId: errorTraceId(error)
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
return withRetryConfig({
|
|
269
|
+
callback
|
|
270
|
+
});
|
|
271
|
+
};
|
|
260
272
|
const requestAuthorize = async firstTime => {
|
|
261
273
|
const calls = [];
|
|
262
274
|
const callsAfterRefresh = [];
|
|
263
275
|
calls.push(__refreshToken());
|
|
264
276
|
if (firstTime) {
|
|
265
|
-
const getRetryWithBlockingCallbackPayload = requestName => {
|
|
266
|
-
const callback = (_, error) => {
|
|
267
|
-
if (!error) return;
|
|
268
|
-
actions.setErrorByRequestName({
|
|
269
|
-
requestName,
|
|
270
|
-
traceId: errorTraceId(error)
|
|
271
|
-
});
|
|
272
|
-
};
|
|
273
|
-
return withRetryConfig({
|
|
274
|
-
callback
|
|
275
|
-
});
|
|
276
|
-
};
|
|
277
277
|
actions.setAuthState({
|
|
278
278
|
isLoading: true
|
|
279
279
|
});
|
|
@@ -300,13 +300,13 @@ export default ((store, api, sharedActions) => {
|
|
|
300
300
|
};
|
|
301
301
|
const requestAuthorizeSSR = async payload => {
|
|
302
302
|
const calls = [];
|
|
303
|
-
calls.push(actions.loadSocialLoginsConfigurationV2());
|
|
304
|
-
calls.push(actions.loadAllowSignUps());
|
|
305
|
-
calls.push(__loadSSOPublicConfigurationFunction());
|
|
306
|
-
calls.push(actions.loadVendorPublicInfo());
|
|
303
|
+
calls.push(actions.loadSocialLoginsConfigurationV2(withRetryConfig()));
|
|
304
|
+
calls.push(actions.loadAllowSignUps(getRetryWithBlockingCallbackPayload(REQUEST_NAME.LOAD_ALLOW_SIGNUPS)));
|
|
305
|
+
calls.push(__loadSSOPublicConfigurationFunction(getRetryWithBlockingCallbackPayload(REQUEST_NAME.LOAD_SSO_PUBLIC_CONFIGURATION)));
|
|
306
|
+
calls.push(actions.loadVendorPublicInfo(withRetryConfig()));
|
|
307
307
|
calls.push(__refreshMetadata());
|
|
308
308
|
calls.push(__isMFARequiredSSR(payload));
|
|
309
|
-
calls.push(actions.loadCustomLoginRoutes());
|
|
309
|
+
calls.push(actions.loadCustomLoginRoutes(getRetryWithBlockingCallbackPayload(REQUEST_NAME.LOAD_CUSTOM_LOGIN_ROUTES)));
|
|
310
310
|
await Promise.all(calls);
|
|
311
311
|
};
|
|
312
312
|
const ssoPreloginFailed = async _ref3 => {
|
package/index.js
CHANGED
|
@@ -249,7 +249,7 @@ var _default = (store, api, sharedActions) => {
|
|
|
249
249
|
routes
|
|
250
250
|
} = store.auth;
|
|
251
251
|
if ((0, _helpers3.isMfaRequired)(user, store.root.appName)) {
|
|
252
|
-
const mfaRequiredState = await actions.getMfaRequiredState(user);
|
|
252
|
+
const mfaRequiredState = await actions.getMfaRequiredState(user, _constants.DEFAULT_RETRY_CONFIG, true);
|
|
253
253
|
actions.setAuthState(mfaRequiredState);
|
|
254
254
|
onRedirectTo(routes.loginUrl, {
|
|
255
255
|
preserveQueryParams: true
|
|
@@ -262,23 +262,23 @@ var _default = (store, api, sharedActions) => {
|
|
|
262
262
|
const resetLoginState = () => {
|
|
263
263
|
(0, _helpers.deepResetState)(store, ['auth', 'loginState'], _state.initialState);
|
|
264
264
|
};
|
|
265
|
+
const getRetryWithBlockingCallbackPayload = requestName => {
|
|
266
|
+
const callback = (_, error) => {
|
|
267
|
+
if (!error) return;
|
|
268
|
+
actions.setErrorByRequestName({
|
|
269
|
+
requestName,
|
|
270
|
+
traceId: (0, _helpers.errorTraceId)(error)
|
|
271
|
+
});
|
|
272
|
+
};
|
|
273
|
+
return (0, _helpers.withRetryConfig)({
|
|
274
|
+
callback
|
|
275
|
+
});
|
|
276
|
+
};
|
|
265
277
|
const requestAuthorize = async firstTime => {
|
|
266
278
|
const calls = [];
|
|
267
279
|
const callsAfterRefresh = [];
|
|
268
280
|
calls.push(__refreshToken());
|
|
269
281
|
if (firstTime) {
|
|
270
|
-
const getRetryWithBlockingCallbackPayload = requestName => {
|
|
271
|
-
const callback = (_, error) => {
|
|
272
|
-
if (!error) return;
|
|
273
|
-
actions.setErrorByRequestName({
|
|
274
|
-
requestName,
|
|
275
|
-
traceId: (0, _helpers.errorTraceId)(error)
|
|
276
|
-
});
|
|
277
|
-
};
|
|
278
|
-
return (0, _helpers.withRetryConfig)({
|
|
279
|
-
callback
|
|
280
|
-
});
|
|
281
|
-
};
|
|
282
282
|
actions.setAuthState({
|
|
283
283
|
isLoading: true
|
|
284
284
|
});
|
|
@@ -305,13 +305,13 @@ var _default = (store, api, sharedActions) => {
|
|
|
305
305
|
};
|
|
306
306
|
const requestAuthorizeSSR = async payload => {
|
|
307
307
|
const calls = [];
|
|
308
|
-
calls.push(actions.loadSocialLoginsConfigurationV2());
|
|
309
|
-
calls.push(actions.loadAllowSignUps());
|
|
310
|
-
calls.push(__loadSSOPublicConfigurationFunction());
|
|
311
|
-
calls.push(actions.loadVendorPublicInfo());
|
|
308
|
+
calls.push(actions.loadSocialLoginsConfigurationV2((0, _helpers.withRetryConfig)()));
|
|
309
|
+
calls.push(actions.loadAllowSignUps(getRetryWithBlockingCallbackPayload(_interfaces2.REQUEST_NAME.LOAD_ALLOW_SIGNUPS)));
|
|
310
|
+
calls.push(__loadSSOPublicConfigurationFunction(getRetryWithBlockingCallbackPayload(_interfaces2.REQUEST_NAME.LOAD_SSO_PUBLIC_CONFIGURATION)));
|
|
311
|
+
calls.push(actions.loadVendorPublicInfo((0, _helpers.withRetryConfig)()));
|
|
312
312
|
calls.push(__refreshMetadata());
|
|
313
313
|
calls.push(__isMFARequiredSSR(payload));
|
|
314
|
-
calls.push(actions.loadCustomLoginRoutes());
|
|
314
|
+
calls.push(actions.loadCustomLoginRoutes(getRetryWithBlockingCallbackPayload(_interfaces2.REQUEST_NAME.LOAD_CUSTOM_LOGIN_ROUTES)));
|
|
315
315
|
await Promise.all(calls);
|
|
316
316
|
};
|
|
317
317
|
const ssoPreloginFailed = async _ref3 => {
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
|
-
"version": "7.31.0-alpha.
|
|
3
|
+
"version": "7.31.0-alpha.6",
|
|
4
4
|
"main": "./node/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Frontegg LTD",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@babel/runtime": "^7.18.6",
|
|
9
9
|
"@frontegg/entitlements-javascript-commons": "1.1.2",
|
|
10
|
-
"@frontegg/rest-api": "7.31.0-alpha.
|
|
10
|
+
"@frontegg/rest-api": "7.31.0-alpha.6",
|
|
11
11
|
"fast-deep-equal": "3.1.3",
|
|
12
12
|
"get-value": "^3.0.1",
|
|
13
13
|
"proxy-compare": "^3.0.0",
|