@frontegg/redux-store 5.1.0 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/auth/index.js CHANGED
@@ -1747,20 +1747,34 @@ function* ssoSagasMock() {
1747
1747
  yield takeEvery(actions.updateSSOAuthorizationRoles, updateAuthorizationRolesMock);
1748
1748
  }
1749
1749
 
1750
- function* loadConfigs() {
1751
- const ssoConfigurations = yield call(api.auth.getSSOConfigurations);
1752
- const oidcConfiguration = yield call(api.auth.getOidcConfiguration);
1753
- const samlMetadata = yield call(api.metadata.getSamlMetadata);
1754
- yield put(actions.setSSOState({
1755
- ssoConfigurations,
1756
- oidcConfiguration,
1757
- samlMetadata
1758
- }));
1750
+ function* loadOidc() {
1751
+ try {
1752
+ const oidcConfiguration = yield call(api.auth.getOidcConfiguration);
1753
+ return oidcConfiguration;
1754
+ }
1755
+ catch (e) {
1756
+ return null;
1757
+ }
1758
+ }
1759
+ function* loadSaml() {
1760
+ try {
1761
+ const samlMetadata = yield call(api.metadata.getSamlMetadata);
1762
+ return samlMetadata;
1763
+ }
1764
+ catch (e) {
1765
+ return null;
1766
+ }
1759
1767
  }
1760
1768
  function* loadSSOConfigurationsV2() {
1761
1769
  try {
1762
1770
  yield put(actions.setSSOLoader({ key: SSOStateKeys.LOAD_SSO_CONFIGURATIONS, value: true }));
1763
- yield loadConfigs();
1771
+ const [oidcConfiguration, samlMetadata] = yield all([call(loadOidc), call(loadSaml)]);
1772
+ const ssoConfigurations = yield call(api.auth.getSSOConfigurations);
1773
+ yield put(actions.setSSOState({
1774
+ ssoConfigurations,
1775
+ oidcConfiguration,
1776
+ samlMetadata
1777
+ }));
1764
1778
  }
1765
1779
  catch (error) {
1766
1780
  yield put(actions.setSSOError({ key: SSOStateKeys.LOAD_SSO_CONFIGURATIONS, value: error.message }));
@@ -1749,20 +1749,34 @@ function* ssoSagasMock() {
1749
1749
  yield effects.takeEvery(actions.updateSSOAuthorizationRoles, updateAuthorizationRolesMock);
1750
1750
  }
1751
1751
 
1752
- function* loadConfigs() {
1753
- const ssoConfigurations = yield effects.call(restApi.api.auth.getSSOConfigurations);
1754
- const oidcConfiguration = yield effects.call(restApi.api.auth.getOidcConfiguration);
1755
- const samlMetadata = yield effects.call(restApi.api.metadata.getSamlMetadata);
1756
- yield effects.put(actions.setSSOState({
1757
- ssoConfigurations,
1758
- oidcConfiguration,
1759
- samlMetadata
1760
- }));
1752
+ function* loadOidc() {
1753
+ try {
1754
+ const oidcConfiguration = yield effects.call(restApi.api.auth.getOidcConfiguration);
1755
+ return oidcConfiguration;
1756
+ }
1757
+ catch (e) {
1758
+ return null;
1759
+ }
1760
+ }
1761
+ function* loadSaml() {
1762
+ try {
1763
+ const samlMetadata = yield effects.call(restApi.api.metadata.getSamlMetadata);
1764
+ return samlMetadata;
1765
+ }
1766
+ catch (e) {
1767
+ return null;
1768
+ }
1761
1769
  }
1762
1770
  function* loadSSOConfigurationsV2() {
1763
1771
  try {
1764
1772
  yield effects.put(actions.setSSOLoader({ key: exports.SSOStateKeys.LOAD_SSO_CONFIGURATIONS, value: true }));
1765
- yield loadConfigs();
1773
+ const [oidcConfiguration, samlMetadata] = yield effects.all([effects.call(loadOidc), effects.call(loadSaml)]);
1774
+ const ssoConfigurations = yield effects.call(restApi.api.auth.getSSOConfigurations);
1775
+ yield effects.put(actions.setSSOState({
1776
+ ssoConfigurations,
1777
+ oidcConfiguration,
1778
+ samlMetadata
1779
+ }));
1766
1780
  }
1767
1781
  catch (error) {
1768
1782
  yield effects.put(actions.setSSOError({ key: exports.SSOStateKeys.LOAD_SSO_CONFIGURATIONS, value: error.message }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@frontegg/redux-store",
3
3
  "libName": "FronteggReduxStore",
4
- "version": "5.1.0",
4
+ "version": "5.5.0",
5
5
  "author": "Frontegg LTD",
6
6
  "main": "./node/index.js",
7
7
  "module": "./index.js",