@frontegg/redux-store 6.152.0 → 6.153.0-alpha.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/CustomLoginState/saga.d.ts +2 -2
- package/auth/CustomLoginState/saga.js +4 -6
- package/auth/Security/SecurityCenterState/saga.d.ts +2 -2
- package/auth/Security/SecurityPolicyState/saga.d.ts +4 -4
- package/auth/SignUp/saga.d.ts +1 -1
- package/auth/SignUp/saga.js +16 -6
- package/auth/interfaces.d.ts +1 -0
- package/index.js +1 -1
- package/node/auth/CustomLoginState/saga.js +4 -6
- package/node/auth/SignUp/saga.js +16 -6
- package/node/index.js +1 -1
- package/package.json +1 -1
|
@@ -4,11 +4,11 @@ export declare function loadTenantMetadata(): Generator<import("redux-saga/effec
|
|
|
4
4
|
payload: Partial<CustomLoginState>;
|
|
5
5
|
type: string;
|
|
6
6
|
}> | import("redux-saga/effects").CallEffect<any>, void, any>;
|
|
7
|
-
export declare function customLoginEnabled(): Generator<import("redux-saga/effects").SelectEffect | import("
|
|
7
|
+
export declare function customLoginEnabled(): Generator<import("redux-saga/effects").SelectEffect | import("@frontegg/rest-api").ResolvedTenantResult | Promise<import("@frontegg/rest-api").ResolvedTenantResult> | undefined, boolean, boolean>;
|
|
8
8
|
export declare function loadCustomLoginRoutes(): Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").PutEffect<{
|
|
9
9
|
payload: Partial<CustomLoginState>;
|
|
10
10
|
type: string;
|
|
11
|
-
}> | import("redux-saga/effects").CallEffect<
|
|
11
|
+
}> | import("redux-saga/effects").CallEffect<Generator<import("redux-saga/effects").SelectEffect | import("@frontegg/rest-api").ResolvedTenantResult | Promise<import("@frontegg/rest-api").ResolvedTenantResult> | undefined, boolean, boolean>> | import("redux-saga/effects").CallEffect<import("@frontegg/rest-api").ISettingsResponse | import("@frontegg/rest-api").IPublicSettingsResponse> | import("redux-saga/effects").PutEffect<{
|
|
12
12
|
payload: Partial<AuthState>;
|
|
13
13
|
type: string;
|
|
14
14
|
}>, void, (false & {
|
|
@@ -8,7 +8,6 @@ import { actions } from '../reducer';
|
|
|
8
8
|
import { delay } from '../utils';
|
|
9
9
|
import { mapMetaDataObjectToActions } from './utils';
|
|
10
10
|
import { errorHandler } from '../../utils';
|
|
11
|
-
import { getFeatureFlags } from '../../helpers';
|
|
12
11
|
import { getSearchParamsFromUrl } from '../LoginState/utils';
|
|
13
12
|
export function* loadTenantMetadata() {
|
|
14
13
|
yield put(actions.setCustomLoginState({
|
|
@@ -61,9 +60,7 @@ function* updateTenantMetadata(_ref) {
|
|
|
61
60
|
}
|
|
62
61
|
}
|
|
63
62
|
export function* customLoginEnabled() {
|
|
64
|
-
var _ContextHolder$getCon;
|
|
65
|
-
const [loginPerTenantFeatureFlag] = yield call(getFeatureFlags, ['admin_portal_login_per_tenant']);
|
|
66
|
-
const hasTenantResolver = !!((_ContextHolder$getCon = ContextHolder.getContext()) != null && _ContextHolder$getCon.tenantResolver);
|
|
63
|
+
var _yield$ContextHolder$, _ContextHolder$getCon, _ContextHolder$getCon2;
|
|
67
64
|
const isAuthenticated = yield select(state => state.auth.isAuthenticated);
|
|
68
65
|
if (isAuthenticated) {
|
|
69
66
|
var _select;
|
|
@@ -73,9 +70,10 @@ export function* customLoginEnabled() {
|
|
|
73
70
|
var _auth$tenantsState$ac;
|
|
74
71
|
return (_auth$tenantsState$ac = auth.tenantsState.activeTenant) == null ? void 0 : _auth$tenantsState$ac.hasCustomLogin;
|
|
75
72
|
})) != null ? _select : false;
|
|
76
|
-
return
|
|
73
|
+
return tenantHasCustomLogin;
|
|
77
74
|
}
|
|
78
|
-
|
|
75
|
+
const resolvedTenant = (_yield$ContextHolder$ = yield (_ContextHolder$getCon = ContextHolder.getContext()) == null ? void 0 : (_ContextHolder$getCon2 = _ContextHolder$getCon.tenantResolver) == null ? void 0 : _ContextHolder$getCon2.call(_ContextHolder$getCon)) == null ? void 0 : _yield$ContextHolder$.tenant;
|
|
76
|
+
return !!resolvedTenant;
|
|
79
77
|
}
|
|
80
78
|
export function* loadCustomLoginRoutes() {
|
|
81
79
|
try {
|
|
@@ -12,7 +12,7 @@ import { IUserV3 } from '../../TeamState/interfaces';
|
|
|
12
12
|
* in order to keep the recommendations and insights updated.
|
|
13
13
|
* @param action - saga to execute
|
|
14
14
|
*/
|
|
15
|
-
export declare function securityCenterSagaWrapper<T>(action: (props: T) => void): (props: T) => Generator<void |
|
|
15
|
+
export declare function securityCenterSagaWrapper<T>(action: (props: T) => void): (props: T) => Generator<void | Generator<import("redux-saga/effects").PutEffect<{
|
|
16
16
|
payload: import("./types").SecurityCenterStateIndicator;
|
|
17
17
|
type: string;
|
|
18
18
|
}> | import("redux-saga/effects").CallEffect<GetRecommendationsResponse> | import("redux-saga/effects").PutEffect<{
|
|
@@ -24,7 +24,7 @@ export declare function securityCenterSagaWrapper<T>(action: (props: T) => void)
|
|
|
24
24
|
}> | import("redux-saga/effects").PutEffect<{
|
|
25
25
|
payload: Partial<import("./interfaces").SecurityCenterState>;
|
|
26
26
|
type: string;
|
|
27
|
-
}> | import("redux-saga/effects").CallEffect<GetInsightsResponse>, void, GetInsightsResponse>, void, boolean[]>;
|
|
27
|
+
}> | import("redux-saga/effects").CallEffect<GetInsightsResponse>, void, GetInsightsResponse> | import("redux-saga/effects").CallEffect<boolean[]>, void, boolean[]>;
|
|
28
28
|
export declare function loadRecommendations(): Generator<import("redux-saga/effects").PutEffect<{
|
|
29
29
|
payload: import("./types").SecurityCenterStateIndicator;
|
|
30
30
|
type: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IVendorConfig } from '@frontegg/rest-api';
|
|
2
2
|
import { IAuthStrategiesConfig } from '@frontegg/rest-api';
|
|
3
|
-
export declare function getSecurityPolicyPublicStateWithCustomLogin(securityPolicyPublicState?: IVendorConfig): Generator<import("redux-saga/effects").CallEffect<
|
|
3
|
+
export declare function getSecurityPolicyPublicStateWithCustomLogin(securityPolicyPublicState?: IVendorConfig): Generator<import("redux-saga/effects").CallEffect<Generator<import("redux-saga/effects").SelectEffect | import("@frontegg/rest-api").ResolvedTenantResult | Promise<import("@frontegg/rest-api").ResolvedTenantResult> | undefined, boolean, boolean>> | import("redux-saga/effects").CallEffect<IAuthStrategiesConfig>, IVendorConfig | {
|
|
4
4
|
authStrategy: import("@frontegg/rest-api").AuthStrategyEnum;
|
|
5
5
|
} | undefined, (false & IAuthStrategiesConfig) | (true & IAuthStrategiesConfig)>;
|
|
6
|
-
export declare function setSecurityPolicyPublicStateForCustomLogin(authStrategy?: IVendorConfig['authStrategy']): Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").CallEffect<
|
|
6
|
+
export declare function setSecurityPolicyPublicStateForCustomLogin(authStrategy?: IVendorConfig['authStrategy']): Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").CallEffect<Generator<import("redux-saga/effects").SelectEffect | import("@frontegg/rest-api").ResolvedTenantResult | Promise<import("@frontegg/rest-api").ResolvedTenantResult> | undefined, boolean, boolean>> | import("redux-saga/effects").PutEffect<{
|
|
7
7
|
payload: Partial<import("../../../interfaces").WithStatus & {
|
|
8
8
|
policy?: IVendorConfig | undefined;
|
|
9
9
|
}>;
|
|
@@ -13,7 +13,7 @@ export declare function setSecurityPolicyPublicStateForCustomLogin(authStrategy?
|
|
|
13
13
|
}>) | (true & Required<import("../../../interfaces").WithStatus & {
|
|
14
14
|
policy?: IVendorConfig | undefined;
|
|
15
15
|
}>)>;
|
|
16
|
-
export declare function loadPublicSecurityPolicy(): Generator<Generator<import("redux-saga/effects").CallEffect<
|
|
16
|
+
export declare function loadPublicSecurityPolicy(): Generator<Generator<import("redux-saga/effects").CallEffect<Generator<import("redux-saga/effects").SelectEffect | import("@frontegg/rest-api").ResolvedTenantResult | Promise<import("@frontegg/rest-api").ResolvedTenantResult> | undefined, boolean, boolean>> | import("redux-saga/effects").CallEffect<IAuthStrategiesConfig>, IVendorConfig | {
|
|
17
17
|
authStrategy: import("@frontegg/rest-api").AuthStrategyEnum;
|
|
18
18
|
} | undefined, (false & IAuthStrategiesConfig) | (true & IAuthStrategiesConfig)> | import("redux-saga/effects").PutEffect<{
|
|
19
19
|
payload: Partial<import("../../../interfaces").WithStatus & {
|
|
@@ -22,7 +22,7 @@ export declare function loadPublicSecurityPolicy(): Generator<Generator<import("
|
|
|
22
22
|
type: string;
|
|
23
23
|
}> | import("redux-saga/effects").CallEffect<IVendorConfig>, void, IVendorConfig>;
|
|
24
24
|
export declare function getAuthStrategy(): Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").CallEffect<IAuthStrategiesConfig>, IAuthStrategiesConfig, (false & IAuthStrategiesConfig) | (true & IAuthStrategiesConfig)>;
|
|
25
|
-
export declare function loadPublicAuthStrategiesPolicy(): Generator<import("redux-saga/effects").CallEffect<IAuthStrategiesConfig> | Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").CallEffect<
|
|
25
|
+
export declare function loadPublicAuthStrategiesPolicy(): Generator<import("redux-saga/effects").CallEffect<IAuthStrategiesConfig> | Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").CallEffect<Generator<import("redux-saga/effects").SelectEffect | import("@frontegg/rest-api").ResolvedTenantResult | Promise<import("@frontegg/rest-api").ResolvedTenantResult> | undefined, boolean, boolean>> | import("redux-saga/effects").PutEffect<{
|
|
26
26
|
payload: Partial<import("../../../interfaces").WithStatus & {
|
|
27
27
|
policy?: IVendorConfig | undefined;
|
|
28
28
|
}>;
|
package/auth/SignUp/saga.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { PayloadAction } from '@reduxjs/toolkit';
|
|
|
2
2
|
import { ISignUpResponse, IVendorConfig } from '@frontegg/rest-api';
|
|
3
3
|
import { ISignUpUserPayload } from './interfaces';
|
|
4
4
|
import { AuthState } from '../interfaces';
|
|
5
|
-
export declare function loadAllowSignUps(): Generator<Generator<import("redux-saga/effects").CallEffect<
|
|
5
|
+
export declare function loadAllowSignUps(): Generator<Generator<import("redux-saga/effects").CallEffect<Generator<import("redux-saga/effects").SelectEffect | import("@frontegg/rest-api").ResolvedTenantResult | Promise<import("@frontegg/rest-api").ResolvedTenantResult> | undefined, boolean, boolean>> | import("redux-saga/effects").CallEffect<import("@frontegg/rest-api").IAuthStrategiesConfig>, IVendorConfig | {
|
|
6
6
|
authStrategy: import("@frontegg/rest-api").AuthStrategyEnum;
|
|
7
7
|
} | undefined, (false & import("@frontegg/rest-api").IAuthStrategiesConfig) | (true & import("@frontegg/rest-api").IAuthStrategiesConfig)> | import("redux-saga/effects").PutEffect<{
|
|
8
8
|
payload: Partial<import("../../interfaces").WithStatus & {
|
package/auth/SignUp/saga.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["
|
|
3
|
+
const _excluded = ["phoneNumber"],
|
|
4
|
+
_excluded2 = ["events", "url"];
|
|
4
5
|
import { call, put, select, takeLeading } from 'redux-saga/effects';
|
|
5
6
|
import { api, ContextHolder } from '@frontegg/rest-api';
|
|
6
7
|
import { actions } from '../reducer';
|
|
@@ -39,14 +40,18 @@ export function* loadAllowSignUps() {
|
|
|
39
40
|
}));
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
+
const extractPhoneNumber = _ref => {
|
|
44
|
+
let rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
45
|
+
return rest;
|
|
46
|
+
};
|
|
47
|
+
export function* signUpUser(_ref2) {
|
|
43
48
|
let {
|
|
44
49
|
payload: {
|
|
45
50
|
events,
|
|
46
51
|
url
|
|
47
52
|
}
|
|
48
|
-
} =
|
|
49
|
-
payload = _objectWithoutPropertiesLoose(
|
|
53
|
+
} = _ref2,
|
|
54
|
+
payload = _objectWithoutPropertiesLoose(_ref2.payload, _excluded2);
|
|
50
55
|
yield put(actions.setSignUpState({
|
|
51
56
|
loading: true
|
|
52
57
|
}));
|
|
@@ -62,19 +67,24 @@ export function* signUpUser(_ref) {
|
|
|
62
67
|
userId,
|
|
63
68
|
tenants = [],
|
|
64
69
|
activeTenant
|
|
65
|
-
} = yield call(api.auth.signUpUser,
|
|
70
|
+
} = yield call(api.auth.signUpUser,
|
|
71
|
+
//Currently we are not supporting phone number in signup in the backend
|
|
72
|
+
//Remove this line when we will support it (also make sure when field is optional no empty string is sent)
|
|
73
|
+
extractPhoneNumber(payload));
|
|
66
74
|
if (!payload.invitationToken) {
|
|
67
75
|
var _events$signUpComplet;
|
|
68
76
|
const {
|
|
69
77
|
email,
|
|
70
78
|
name,
|
|
71
|
-
companyName
|
|
79
|
+
companyName,
|
|
80
|
+
phoneNumber
|
|
72
81
|
} = payload;
|
|
73
82
|
const signUpCompletePayload = {
|
|
74
83
|
email,
|
|
75
84
|
name,
|
|
76
85
|
companyName,
|
|
77
86
|
url,
|
|
87
|
+
phoneNumber: phoneNumber || undefined,
|
|
78
88
|
authenticationType: AuthenticationTypes.PASSWORD,
|
|
79
89
|
id: userId,
|
|
80
90
|
tenantId,
|
package/auth/interfaces.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -17,7 +17,6 @@ var _reducer = require("../reducer");
|
|
|
17
17
|
var _utils = require("../utils");
|
|
18
18
|
var _utils2 = require("./utils");
|
|
19
19
|
var _utils3 = require("../../utils");
|
|
20
|
-
var _helpers = require("../../helpers");
|
|
21
20
|
var _utils4 = require("../LoginState/utils");
|
|
22
21
|
const _excluded = ["callback"],
|
|
23
22
|
_excluded2 = ["callback"];
|
|
@@ -72,9 +71,7 @@ function* updateTenantMetadata(_ref) {
|
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
function* customLoginEnabled() {
|
|
75
|
-
var _ContextHolder$getCon;
|
|
76
|
-
const [loginPerTenantFeatureFlag] = yield (0, _effects.call)(_helpers.getFeatureFlags, ['admin_portal_login_per_tenant']);
|
|
77
|
-
const hasTenantResolver = !!((_ContextHolder$getCon = _restApi.ContextHolder.getContext()) != null && _ContextHolder$getCon.tenantResolver);
|
|
74
|
+
var _yield$ContextHolder$, _ContextHolder$getCon, _ContextHolder$getCon2;
|
|
78
75
|
const isAuthenticated = yield (0, _effects.select)(state => state.auth.isAuthenticated);
|
|
79
76
|
if (isAuthenticated) {
|
|
80
77
|
var _select;
|
|
@@ -84,9 +81,10 @@ function* customLoginEnabled() {
|
|
|
84
81
|
var _auth$tenantsState$ac;
|
|
85
82
|
return (_auth$tenantsState$ac = auth.tenantsState.activeTenant) == null ? void 0 : _auth$tenantsState$ac.hasCustomLogin;
|
|
86
83
|
})) != null ? _select : false;
|
|
87
|
-
return
|
|
84
|
+
return tenantHasCustomLogin;
|
|
88
85
|
}
|
|
89
|
-
|
|
86
|
+
const resolvedTenant = (_yield$ContextHolder$ = yield (_ContextHolder$getCon = _restApi.ContextHolder.getContext()) == null ? void 0 : (_ContextHolder$getCon2 = _ContextHolder$getCon.tenantResolver) == null ? void 0 : _ContextHolder$getCon2.call(_ContextHolder$getCon)) == null ? void 0 : _yield$ContextHolder$.tenant;
|
|
87
|
+
return !!resolvedTenant;
|
|
90
88
|
}
|
|
91
89
|
function* loadCustomLoginRoutes() {
|
|
92
90
|
try {
|
package/node/auth/SignUp/saga.js
CHANGED
|
@@ -19,7 +19,8 @@ var _mfaRequiredState = require("../LoginState/mfaRequiredState.saga");
|
|
|
19
19
|
var _utils = require("../../utils");
|
|
20
20
|
var _utils2 = require("../LoginState/utils");
|
|
21
21
|
var _saga = require("../Security/SecurityPolicyState/saga");
|
|
22
|
-
const _excluded = ["
|
|
22
|
+
const _excluded = ["phoneNumber"],
|
|
23
|
+
_excluded2 = ["events", "url"];
|
|
23
24
|
function* loadAllowSignUps() {
|
|
24
25
|
yield (0, _effects.put)(_reducer.actions.setSignUpState({
|
|
25
26
|
loading: true
|
|
@@ -49,14 +50,18 @@ function* loadAllowSignUps() {
|
|
|
49
50
|
}));
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
+
const extractPhoneNumber = _ref => {
|
|
54
|
+
let rest = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
55
|
+
return rest;
|
|
56
|
+
};
|
|
57
|
+
function* signUpUser(_ref2) {
|
|
53
58
|
let {
|
|
54
59
|
payload: {
|
|
55
60
|
events,
|
|
56
61
|
url
|
|
57
62
|
}
|
|
58
|
-
} =
|
|
59
|
-
payload = (0, _objectWithoutPropertiesLoose2.default)(
|
|
63
|
+
} = _ref2,
|
|
64
|
+
payload = (0, _objectWithoutPropertiesLoose2.default)(_ref2.payload, _excluded2);
|
|
60
65
|
yield (0, _effects.put)(_reducer.actions.setSignUpState({
|
|
61
66
|
loading: true
|
|
62
67
|
}));
|
|
@@ -72,19 +77,24 @@ function* signUpUser(_ref) {
|
|
|
72
77
|
userId,
|
|
73
78
|
tenants = [],
|
|
74
79
|
activeTenant
|
|
75
|
-
} = yield (0, _effects.call)(_restApi.api.auth.signUpUser,
|
|
80
|
+
} = yield (0, _effects.call)(_restApi.api.auth.signUpUser,
|
|
81
|
+
//Currently we are not supporting phone number in signup in the backend
|
|
82
|
+
//Remove this line when we will support it (also make sure when field is optional no empty string is sent)
|
|
83
|
+
extractPhoneNumber(payload));
|
|
76
84
|
if (!payload.invitationToken) {
|
|
77
85
|
var _events$signUpComplet;
|
|
78
86
|
const {
|
|
79
87
|
email,
|
|
80
88
|
name,
|
|
81
|
-
companyName
|
|
89
|
+
companyName,
|
|
90
|
+
phoneNumber
|
|
82
91
|
} = payload;
|
|
83
92
|
const signUpCompletePayload = {
|
|
84
93
|
email,
|
|
85
94
|
name,
|
|
86
95
|
companyName,
|
|
87
96
|
url,
|
|
97
|
+
phoneNumber: phoneNumber || undefined,
|
|
88
98
|
authenticationType: _interfaces2.AuthenticationTypes.PASSWORD,
|
|
89
99
|
id: userId,
|
|
90
100
|
tenantId,
|
package/node/index.js
CHANGED