@frontegg/redux-store 6.75.0-alpha.6 → 6.75.0-alpha.7

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.
@@ -1,17 +1,17 @@
1
1
  import { IVendorConfig } from '@frontegg/rest-api';
2
2
  import { IAuthStrategiesConfig } from '@frontegg/rest-api';
3
- export declare function loadPublicSecurityPolicy(): Generator<import("redux-saga/effects").CallEffect<IVendorConfig> | import("redux-saga/effects").PutEffect<{
3
+ export declare function loadPublicSecurityPolicy(): Generator<import("redux-saga/effects").CallEffect<IVendorConfig> | import("redux-saga/effects").CallEffect<IAuthStrategiesConfig> | import("redux-saga/effects").PutEffect<{
4
4
  payload: Partial<import("../../interfaces").WithStatus & {
5
5
  policy?: IVendorConfig | undefined;
6
6
  }>;
7
7
  type: string;
8
- }>, void, IVendorConfig>;
9
- export declare function loadPublicAuthStrategiesPolicy(): Generator<import("redux-saga/effects").PutEffect<{
8
+ }>, void, IVendorConfig & IAuthStrategiesConfig>;
9
+ export declare function loadPublicAuthStrategiesPolicy(): Generator<import("redux-saga/effects").CallEffect<IAuthStrategiesConfig> | import("redux-saga/effects").PutEffect<{
10
10
  payload: Partial<import("../../interfaces").WithStatus & {
11
11
  policy?: IAuthStrategiesConfig | undefined;
12
12
  }>;
13
13
  type: string;
14
- }> | import("redux-saga/effects").CallEffect<IAuthStrategiesConfig>, void, IAuthStrategiesConfig>;
14
+ }>, void, IAuthStrategiesConfig>;
15
15
  export declare function securityPolicySagas(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
16
16
  /*********************************
17
17
  * Preview Sagas
@@ -11,6 +11,7 @@ import { api } from '@frontegg/rest-api';
11
11
  import { actions } from '../reducer';
12
12
  import { delay } from '../utils';
13
13
  import { policyDemo, policyMfaDemo, policyLockoutDemo, policyPasswordHistoryDemo, publicSecurityPolicy } from '../dummy';
14
+ import { useFeatureFlags } from '../../helpers';
14
15
  function* loadSecurityPolicy() {
15
16
  yield put(actions.setSecurityPolicyGlobalState({
16
17
  loading: true,
@@ -43,6 +44,13 @@ export function* loadPublicSecurityPolicy() {
43
44
  }));
44
45
  try {
45
46
  const policy = yield call(api.auth.getVendorConfig);
47
+ const [withLoginPerTenant] = useFeatureFlags(['admin_portal_login_per_tenant']);
48
+ if (withLoginPerTenant) {
49
+ const authStrategies = yield call(api.auth.getVendorPublicAuthStrategiesConfig);
50
+ if (authStrategies.mainAuthStrategies.length > 0) {
51
+ policy.authStrategy = authStrategies.mainAuthStrategies[0].strategy;
52
+ }
53
+ }
46
54
  yield put(actions.setSecurityPolicyPublicState({
47
55
  policy,
48
56
  loading: false
@@ -1,16 +1,16 @@
1
1
  import { PayloadAction } from '@reduxjs/toolkit';
2
- import { IVendorConfig } from '@frontegg/rest-api';
2
+ import { IAuthStrategiesConfig, IVendorConfig } from '@frontegg/rest-api';
3
3
  import { ISignUpUserPayload } from './interfaces';
4
4
  import { AuthState } from '../interfaces';
5
5
  export declare function loadAllowSignUps(): Generator<import("redux-saga/effects").PutEffect<{
6
6
  payload: Partial<import("./interfaces").SignUpState>;
7
7
  type: string;
8
- }> | import("redux-saga/effects").CallEffect<IVendorConfig> | import("redux-saga/effects").PutEffect<{
8
+ }> | import("redux-saga/effects").CallEffect<IVendorConfig> | import("redux-saga/effects").CallEffect<IAuthStrategiesConfig> | import("redux-saga/effects").PutEffect<{
9
9
  payload: Partial<import("../../interfaces").WithStatus & {
10
10
  policy?: IVendorConfig | undefined;
11
11
  }>;
12
12
  type: string;
13
- }>, void, IVendorConfig>;
13
+ }>, void, IVendorConfig & IAuthStrategiesConfig>;
14
14
  export declare function signUpUser({ payload: { events, url, ...payload } }: PayloadAction<ISignUpUserPayload>): Generator<import("redux-saga/effects").PutEffect<{
15
15
  payload: Partial<import("./interfaces").SignUpState>;
16
16
  type: string;
@@ -6,12 +6,21 @@ import { actions } from '../reducer';
6
6
  import { SignUpStage } from './interfaces';
7
7
  import { AuthenticationTypes } from '../interfaces';
8
8
  import { getMfaRequiredState, isMfaRequired } from '../LoginState/saga';
9
+ import { useFeatureFlags } from '../../helpers';
9
10
  export function* loadAllowSignUps() {
10
11
  yield put(actions.setSignUpState({
11
12
  loading: true
12
13
  }));
13
14
  try {
14
15
  const policy = yield call(api.auth.getVendorConfig);
16
+ const authStrategies = yield call(api.auth.getVendorPublicAuthStrategiesConfig);
17
+ const [withLoginPerTenant] = useFeatureFlags(['admin_portal_login_per_tenant']);
18
+ if (withLoginPerTenant) {
19
+ const authStrategies = yield call(api.auth.getVendorPublicAuthStrategiesConfig);
20
+ if (authStrategies.mainAuthStrategies.length > 0) {
21
+ policy.authStrategy = authStrategies.mainAuthStrategies[0].strategy;
22
+ }
23
+ }
15
24
  const {
16
25
  allowSignups: allowSignUps,
17
26
  allowNotVerifiedUsersLogin
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.75.0-alpha.6
1
+ /** @license Frontegg v6.75.0-alpha.7
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -16,6 +16,7 @@ var _restApi = require("@frontegg/rest-api");
16
16
  var _reducer = require("../reducer");
17
17
  var _utils = require("../utils");
18
18
  var _dummy = require("../dummy");
19
+ var _helpers = require("../../helpers");
19
20
  const _excluded = ["callback"],
20
21
  _excluded2 = ["callback"],
21
22
  _excluded3 = ["callback"],
@@ -54,6 +55,13 @@ function* loadPublicSecurityPolicy() {
54
55
  }));
55
56
  try {
56
57
  const policy = yield (0, _effects.call)(_restApi.api.auth.getVendorConfig);
58
+ const [withLoginPerTenant] = (0, _helpers.useFeatureFlags)(['admin_portal_login_per_tenant']);
59
+ if (withLoginPerTenant) {
60
+ const authStrategies = yield (0, _effects.call)(_restApi.api.auth.getVendorPublicAuthStrategiesConfig);
61
+ if (authStrategies.mainAuthStrategies.length > 0) {
62
+ policy.authStrategy = authStrategies.mainAuthStrategies[0].strategy;
63
+ }
64
+ }
57
65
  yield (0, _effects.put)(_reducer.actions.setSecurityPolicyPublicState({
58
66
  policy,
59
67
  loading: false
@@ -15,6 +15,7 @@ var _reducer = require("../reducer");
15
15
  var _interfaces = require("./interfaces");
16
16
  var _interfaces2 = require("../interfaces");
17
17
  var _saga = require("../LoginState/saga");
18
+ var _helpers = require("../../helpers");
18
19
  const _excluded = ["events", "url"];
19
20
  function* loadAllowSignUps() {
20
21
  yield (0, _effects.put)(_reducer.actions.setSignUpState({
@@ -22,6 +23,14 @@ function* loadAllowSignUps() {
22
23
  }));
23
24
  try {
24
25
  const policy = yield (0, _effects.call)(_restApi.api.auth.getVendorConfig);
26
+ const authStrategies = yield (0, _effects.call)(_restApi.api.auth.getVendorPublicAuthStrategiesConfig);
27
+ const [withLoginPerTenant] = (0, _helpers.useFeatureFlags)(['admin_portal_login_per_tenant']);
28
+ if (withLoginPerTenant) {
29
+ const authStrategies = yield (0, _effects.call)(_restApi.api.auth.getVendorPublicAuthStrategiesConfig);
30
+ if (authStrategies.mainAuthStrategies.length > 0) {
31
+ policy.authStrategy = authStrategies.mainAuthStrategies[0].strategy;
32
+ }
33
+ }
25
34
  const {
26
35
  allowSignups: allowSignUps,
27
36
  allowNotVerifiedUsersLogin
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.75.0-alpha.6
1
+ /** @license Frontegg v6.75.0-alpha.7
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@frontegg/redux-store",
3
- "version": "6.75.0-alpha.6",
3
+ "version": "6.75.0-alpha.7",
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
- "@frontegg/rest-api": "3.0.85",
9
+ "@frontegg/rest-api": "3.0.87",
10
10
  "@reduxjs/toolkit": "^1.8.5",
11
11
  "redux-saga": "^1.2.1",
12
12
  "uuid": "^8.3.2"