@frontegg/redux-store 7.40.0 → 7.41.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/LoginState/actions/index.js +19 -6
- package/auth/Security/RestrictionsState/actions.js +2 -2
- package/auth/index.d.ts +33 -34
- package/auth/index.js +38 -37
- package/auth/interfaces.d.ts +6 -1
- package/index.js +1 -1
- package/mocks/auth-mocks/loginActions.mocks.js +3 -1
- package/node/auth/LoginState/actions/index.js +17 -2
- package/node/auth/Security/RestrictionsState/actions.js +2 -2
- package/node/auth/index.js +44 -42
- package/node/index.js +1 -1
- package/node/mocks/auth-mocks/loginActions.mocks.js +3 -1
- package/package.json +2 -2
|
@@ -23,19 +23,17 @@ import mfaWithEmailCodeActions from './mfaWithEmailCode.actions';
|
|
|
23
23
|
import mfaWithSMSActions from './mfaWithSMS.actions';
|
|
24
24
|
import mfaWithWebAuthnActions from './mfaWithWebAuthn.actions';
|
|
25
25
|
import { LoginFlow, LoginStep } from '../interfaces';
|
|
26
|
-
import { base64urlDecode, deepResetState, errorHandler, errorTraceId, publicKeyCredentialToJSON, retryIfNeeded, withRetryConfig } from '../../../helpers';
|
|
26
|
+
import { base64urlDecode, deepResetState, errorHandler, errorTraceId, GTMEventAction, publicKeyCredentialToJSON, reportGTMEvent, retryIfNeeded, withRetryConfig } from '../../../helpers';
|
|
27
27
|
import { initialState } from '../state';
|
|
28
28
|
import { getSearchParam, isEmailPayload, TENANT_ID_PARAM_KEY } from '../helpers';
|
|
29
|
-
import { AuthStrategyEnum, ContextHolder, WebAuthnDeviceType } from '@frontegg/rest-api';
|
|
29
|
+
import { AuthStrategyEnum, ContextHolder, removeTabTenantFromSessionStorage, WebAuthnDeviceType } from '@frontegg/rest-api';
|
|
30
30
|
import hostedLoginAuthorizeActions from './hostedLoginAuthorize.actions';
|
|
31
31
|
import { FronteggNativeModule, isEntitlementsDeeplyEqual } from '../../../toolkit';
|
|
32
32
|
import { REQUEST_NAME, UserVerifiedOriginTypes } from '../../interfaces';
|
|
33
33
|
import { authStrategyLoginStepMap } from '../consts';
|
|
34
|
-
import { GTMEventAction, reportGTMEvent } from '../../../helpers';
|
|
35
34
|
import { isMfaRequired } from '../../helpers';
|
|
36
35
|
import { MFAStep } from '../../MfaState/interfaces';
|
|
37
36
|
import { SamlVendors } from '../../SSOState/interfaces';
|
|
38
|
-
import { removeTabTenantFromSessionStorage } from '@frontegg/rest-api';
|
|
39
37
|
import { DEFAULT_RETRY_CONFIG } from '../../../constants';
|
|
40
38
|
export default ((store, api, sharedActions) => {
|
|
41
39
|
const actions = sharedActions;
|
|
@@ -982,14 +980,29 @@ export default ((store, api, sharedActions) => {
|
|
|
982
980
|
callback
|
|
983
981
|
} = payload;
|
|
984
982
|
try {
|
|
983
|
+
actions.setAuthState({
|
|
984
|
+
userIpData: {
|
|
985
|
+
loading: true
|
|
986
|
+
}
|
|
987
|
+
});
|
|
985
988
|
const {
|
|
986
|
-
ip
|
|
989
|
+
ip,
|
|
990
|
+
country_code
|
|
987
991
|
} = await api.metadata.getCurrentUserIpMetadata();
|
|
988
992
|
actions.setAuthState({
|
|
989
|
-
|
|
993
|
+
userIpData: {
|
|
994
|
+
ip,
|
|
995
|
+
countryCode: country_code,
|
|
996
|
+
loading: false
|
|
997
|
+
}
|
|
990
998
|
});
|
|
991
999
|
callback == null ? void 0 : callback(true);
|
|
992
1000
|
} catch (e) {
|
|
1001
|
+
actions.setAuthState({
|
|
1002
|
+
userIpData: {
|
|
1003
|
+
loading: false
|
|
1004
|
+
}
|
|
1005
|
+
});
|
|
993
1006
|
callback == null ? void 0 : callback(false);
|
|
994
1007
|
}
|
|
995
1008
|
};
|
|
@@ -245,8 +245,8 @@ export default ((store, api, sharedActions) => {
|
|
|
245
245
|
error: null
|
|
246
246
|
});
|
|
247
247
|
try {
|
|
248
|
-
var _store$auth$
|
|
249
|
-
const userIp = (_store$auth$
|
|
248
|
+
var _store$auth$userIpDat, _store$auth$userIpDat2;
|
|
249
|
+
const userIp = (_store$auth$userIpDat = (_store$auth$userIpDat2 = store.auth.userIpData) == null ? void 0 : _store$auth$userIpDat2.ip) != null ? _store$auth$userIpDat : '';
|
|
250
250
|
await Promise.all([api.auth.createIPRestriction({
|
|
251
251
|
ip: userIp,
|
|
252
252
|
isActive: true,
|
package/auth/index.d.ts
CHANGED
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
import { DeepPartial, FronteggActions, FronteggState, RestApi } from '../interfaces';
|
|
2
|
+
import { AuthState, SingleErrorByRequestDataPayload, User } from './interfaces';
|
|
3
|
+
import { buildAcceptInvitationActions } from './AcceptInvitationState';
|
|
4
|
+
import { buildAccountSettingsActions } from './AccountSettingsState';
|
|
5
|
+
import { buildActivateAccountActions } from './ActivateAccountState';
|
|
6
|
+
import { buildUnlockAccountActions } from './UnlockAccountState';
|
|
7
|
+
import { buildApiTokensActions } from './ApiTokensState';
|
|
8
|
+
import { buildApplicationsActions } from './ApplicationsState';
|
|
9
|
+
import { buildCustomLoginActions } from './CustomLoginState';
|
|
10
|
+
import { buildForgotPasswordActions } from './ForgotPasswordState';
|
|
11
|
+
import { buildGroupsActions } from './GroupsState';
|
|
12
|
+
import { buildGroupsDialogsActions } from './GroupsDialogsState';
|
|
13
|
+
import { buildImpersonateActions } from './ImpersonateState';
|
|
14
|
+
import { buildLoginActions } from './LoginState';
|
|
15
|
+
import { buildMfaActions } from './MfaState';
|
|
16
|
+
import { buildAllAccountsActions, buildAllAccountsDialogActions } from './MSP';
|
|
17
|
+
import { buildPasskeysActions } from './PasskeysState';
|
|
18
|
+
import { buildProfileActions } from './ProfileState';
|
|
19
|
+
import { buildProvisioningActions } from './ProvisioningState';
|
|
20
|
+
import { buildResetPhoneNumberActions } from './ResetPhoneNumberState';
|
|
21
|
+
import { buildRolesActions } from './RolesState';
|
|
22
|
+
import { buildRestrictionsActions } from './Security/RestrictionsState';
|
|
23
|
+
import { buildSecurityCenterActions } from './Security/SecurityCenterState';
|
|
24
|
+
import { buildSecurityPolicyActions } from './Security/SecurityPolicyState';
|
|
25
|
+
import { buildSessionsPolicyActions } from './Security/SessionsPolicyState';
|
|
26
|
+
import { buildSessionsActions } from './SessionsState';
|
|
27
|
+
import { buildSignUpActions } from './SignUpState';
|
|
28
|
+
import { buildSmsActions } from './SmsState';
|
|
29
|
+
import { buildSocialLoginActions } from './SocialLoginState';
|
|
30
|
+
import { buildSSOActions } from './SSOState';
|
|
31
|
+
import { buildStepUpActions } from './StepUpState';
|
|
32
|
+
import { buildTeamActions } from './TeamState';
|
|
33
|
+
import { buildTenantsActions } from './TenantsState';
|
|
34
|
+
import { buildEntitlementsActions } from './Entitlements';
|
|
2
35
|
export * from './AcceptInvitationState/interfaces';
|
|
3
36
|
export * from './AccountSettingsState/interfaces';
|
|
4
37
|
export * from './ActivateAccountState/interfaces';
|
|
@@ -33,40 +66,6 @@ export * from './StepUpState/interfaces';
|
|
|
33
66
|
export * from './TeamState/interfaces';
|
|
34
67
|
export * from './TenantsState/interfaces';
|
|
35
68
|
export * from './interfaces';
|
|
36
|
-
import { AuthState, User, SingleErrorByRequestDataPayload } from './interfaces';
|
|
37
|
-
import { buildAcceptInvitationActions } from './AcceptInvitationState';
|
|
38
|
-
import { buildAccountSettingsActions } from './AccountSettingsState';
|
|
39
|
-
import { buildActivateAccountActions } from './ActivateAccountState';
|
|
40
|
-
import { buildUnlockAccountActions } from './UnlockAccountState';
|
|
41
|
-
import { buildApiTokensActions } from './ApiTokensState';
|
|
42
|
-
import { buildApplicationsActions } from './ApplicationsState';
|
|
43
|
-
import { buildCustomLoginActions } from './CustomLoginState';
|
|
44
|
-
import { buildForgotPasswordActions } from './ForgotPasswordState';
|
|
45
|
-
import { buildGroupsActions } from './GroupsState';
|
|
46
|
-
import { buildGroupsDialogsActions } from './GroupsDialogsState';
|
|
47
|
-
import { buildImpersonateActions } from './ImpersonateState';
|
|
48
|
-
import { buildLoginActions } from './LoginState';
|
|
49
|
-
import { buildMfaActions } from './MfaState';
|
|
50
|
-
import { buildAllAccountsActions } from './MSP';
|
|
51
|
-
import { buildAllAccountsDialogActions } from './MSP';
|
|
52
|
-
import { buildPasskeysActions } from './PasskeysState';
|
|
53
|
-
import { buildProfileActions } from './ProfileState';
|
|
54
|
-
import { buildProvisioningActions } from './ProvisioningState';
|
|
55
|
-
import { buildResetPhoneNumberActions } from './ResetPhoneNumberState';
|
|
56
|
-
import { buildRolesActions } from './RolesState';
|
|
57
|
-
import { buildRestrictionsActions } from './Security/RestrictionsState';
|
|
58
|
-
import { buildSecurityCenterActions } from './Security/SecurityCenterState';
|
|
59
|
-
import { buildSecurityPolicyActions } from './Security/SecurityPolicyState';
|
|
60
|
-
import { buildSessionsPolicyActions } from './Security/SessionsPolicyState';
|
|
61
|
-
import { buildSessionsActions } from './SessionsState';
|
|
62
|
-
import { buildSignUpActions } from './SignUpState';
|
|
63
|
-
import { buildSmsActions } from './SmsState';
|
|
64
|
-
import { buildSocialLoginActions } from './SocialLoginState';
|
|
65
|
-
import { buildSSOActions } from './SSOState';
|
|
66
|
-
import { buildStepUpActions } from './StepUpState';
|
|
67
|
-
import { buildTeamActions } from './TeamState';
|
|
68
|
-
import { buildTenantsActions } from './TenantsState';
|
|
69
|
-
import { buildEntitlementsActions } from './Entitlements';
|
|
70
69
|
export declare const createAuthState: (_overrideState?: DeepPartial<AuthState>) => AuthState;
|
|
71
70
|
export declare const buildAuthActions: (store: FronteggState, api: RestApi, actions: FronteggActions, snapshotAuthState: AuthState) => [AuthActions, AuthStateActions];
|
|
72
71
|
export type AcceptInvitationActions = ReturnType<typeof buildAcceptInvitationActions>;
|
package/auth/index.js
CHANGED
|
@@ -2,6 +2,41 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["routes"],
|
|
4
4
|
_excluded2 = ["requestName"];
|
|
5
|
+
import { buildAcceptInvitationActions, createAcceptInvitationState } from './AcceptInvitationState';
|
|
6
|
+
import { buildAccountSettingsActions, createAccountSettingsState } from './AccountSettingsState';
|
|
7
|
+
import { buildActivateAccountActions, createActivateAccountState } from './ActivateAccountState';
|
|
8
|
+
import { buildUnlockAccountActions, createUnlockAccountState } from './UnlockAccountState';
|
|
9
|
+
import { buildApiTokensActions, createApiTokensState } from './ApiTokensState';
|
|
10
|
+
import { buildApplicationsActions, createApplicationsState } from './ApplicationsState';
|
|
11
|
+
import { buildCustomLoginActions, createCustomLoginState } from './CustomLoginState';
|
|
12
|
+
import { buildForgotPasswordActions, createForgotPasswordState } from './ForgotPasswordState';
|
|
13
|
+
import { buildGroupsActions, createGroupsState } from './GroupsState';
|
|
14
|
+
import { buildGroupsDialogsActions, createGroupsDialogsState } from './GroupsDialogsState';
|
|
15
|
+
import { buildImpersonateActions, createImpersonateState } from './ImpersonateState';
|
|
16
|
+
import { buildLoginActions, createLoginState } from './LoginState';
|
|
17
|
+
import { buildMfaActions, createMfaState } from './MfaState';
|
|
18
|
+
import { buildAllAccountsActions, buildAllAccountsDialogActions, createAllAccountsDialogState, createAllAccountsState } from './MSP';
|
|
19
|
+
import { buildPasskeysActions, createPasskeysState } from './PasskeysState';
|
|
20
|
+
import { buildProfileActions, createProfileState } from './ProfileState';
|
|
21
|
+
import { buildProvisioningActions, createProvisioningState } from './ProvisioningState';
|
|
22
|
+
import { buildResetPhoneNumberActions, createResetPhoneNumberState } from './ResetPhoneNumberState';
|
|
23
|
+
import { buildRolesActions, createRolesState } from './RolesState';
|
|
24
|
+
import { buildRestrictionsActions, createRestrictionsState } from './Security/RestrictionsState';
|
|
25
|
+
import { buildSecurityCenterActions, createSecurityCenterState } from './Security/SecurityCenterState';
|
|
26
|
+
import { buildSecurityPolicyActions, createSecurityPolicyState } from './Security/SecurityPolicyState';
|
|
27
|
+
import { buildSessionsPolicyActions, createSessionsPolicyState } from './Security/SessionsPolicyState';
|
|
28
|
+
import { buildSessionsActions, createSessionsState } from './SessionsState';
|
|
29
|
+
import { buildSignUpActions, createSignUpState } from './SignUpState';
|
|
30
|
+
import { buildSmsActions, createSmsState } from './SmsState';
|
|
31
|
+
import { buildSocialLoginActions, createSocialLoginState } from './SocialLoginState';
|
|
32
|
+
import { buildSSOActions, createSSOState } from './SSOState';
|
|
33
|
+
import { buildStepUpActions, createStepUpState } from './StepUpState';
|
|
34
|
+
import { buildTeamActions, createTeamState } from './TeamState';
|
|
35
|
+
import { buildTenantsActions, createTenantsState } from './TenantsState';
|
|
36
|
+
import { defaultFronteggRoutes } from './LoginState/consts';
|
|
37
|
+
import { deepResetState, isProxy } from '../helpers';
|
|
38
|
+
import { buildEntitlementsActions } from './Entitlements';
|
|
39
|
+
import { createProxy } from '../toolkit/proxy';
|
|
5
40
|
export * from './AcceptInvitationState/interfaces';
|
|
6
41
|
export * from './AccountSettingsState/interfaces';
|
|
7
42
|
export * from './ActivateAccountState/interfaces';
|
|
@@ -36,42 +71,6 @@ export * from './StepUpState/interfaces';
|
|
|
36
71
|
export * from './TeamState/interfaces';
|
|
37
72
|
export * from './TenantsState/interfaces';
|
|
38
73
|
export * from './interfaces';
|
|
39
|
-
import { createAcceptInvitationState, buildAcceptInvitationActions } from './AcceptInvitationState';
|
|
40
|
-
import { createAccountSettingsState, buildAccountSettingsActions } from './AccountSettingsState';
|
|
41
|
-
import { createActivateAccountState, buildActivateAccountActions } from './ActivateAccountState';
|
|
42
|
-
import { createUnlockAccountState, buildUnlockAccountActions } from './UnlockAccountState';
|
|
43
|
-
import { createApiTokensState, buildApiTokensActions } from './ApiTokensState';
|
|
44
|
-
import { createApplicationsState, buildApplicationsActions } from './ApplicationsState';
|
|
45
|
-
import { createCustomLoginState, buildCustomLoginActions } from './CustomLoginState';
|
|
46
|
-
import { buildForgotPasswordActions, createForgotPasswordState } from './ForgotPasswordState';
|
|
47
|
-
import { createGroupsState, buildGroupsActions } from './GroupsState';
|
|
48
|
-
import { createGroupsDialogsState, buildGroupsDialogsActions } from './GroupsDialogsState';
|
|
49
|
-
import { createImpersonateState, buildImpersonateActions } from './ImpersonateState';
|
|
50
|
-
import { createLoginState, buildLoginActions } from './LoginState';
|
|
51
|
-
import { createMfaState, buildMfaActions } from './MfaState';
|
|
52
|
-
import { createAllAccountsState, buildAllAccountsActions } from './MSP';
|
|
53
|
-
import { createAllAccountsDialogState, buildAllAccountsDialogActions } from './MSP';
|
|
54
|
-
import { createPasskeysState, buildPasskeysActions } from './PasskeysState';
|
|
55
|
-
import { createProfileState, buildProfileActions } from './ProfileState';
|
|
56
|
-
import { createProvisioningState, buildProvisioningActions } from './ProvisioningState';
|
|
57
|
-
import { createResetPhoneNumberState, buildResetPhoneNumberActions } from './ResetPhoneNumberState';
|
|
58
|
-
import { createRolesState, buildRolesActions } from './RolesState';
|
|
59
|
-
import { createRestrictionsState, buildRestrictionsActions } from './Security/RestrictionsState';
|
|
60
|
-
import { createSecurityCenterState, buildSecurityCenterActions } from './Security/SecurityCenterState';
|
|
61
|
-
import { createSecurityPolicyState, buildSecurityPolicyActions } from './Security/SecurityPolicyState';
|
|
62
|
-
import { createSessionsPolicyState, buildSessionsPolicyActions } from './Security/SessionsPolicyState';
|
|
63
|
-
import { createSessionsState, buildSessionsActions } from './SessionsState';
|
|
64
|
-
import { createSignUpState, buildSignUpActions } from './SignUpState';
|
|
65
|
-
import { createSmsState, buildSmsActions } from './SmsState';
|
|
66
|
-
import { createSocialLoginState, buildSocialLoginActions } from './SocialLoginState';
|
|
67
|
-
import { createSSOState, buildSSOActions } from './SSOState';
|
|
68
|
-
import { createStepUpState, buildStepUpActions } from './StepUpState';
|
|
69
|
-
import { createTeamState, buildTeamActions } from './TeamState';
|
|
70
|
-
import { createTenantsState, buildTenantsActions } from './TenantsState';
|
|
71
|
-
import { defaultFronteggRoutes } from './LoginState/consts';
|
|
72
|
-
import { deepResetState, isProxy } from '../helpers';
|
|
73
|
-
import { buildEntitlementsActions } from './Entitlements';
|
|
74
|
-
import { createProxy } from '../toolkit/proxy';
|
|
75
74
|
export const createAuthState = _overrideState => {
|
|
76
75
|
const _ref = _overrideState != null ? _overrideState : {},
|
|
77
76
|
{
|
|
@@ -87,7 +86,9 @@ export const createAuthState = _overrideState => {
|
|
|
87
86
|
user: null,
|
|
88
87
|
error: undefined,
|
|
89
88
|
errorByRequest: {},
|
|
90
|
-
|
|
89
|
+
userIpData: {
|
|
90
|
+
loading: false
|
|
91
|
+
}
|
|
91
92
|
}, overrideState, {
|
|
92
93
|
// nested states
|
|
93
94
|
acceptInvitationState: createAcceptInvitationState(overrideState == null ? void 0 : overrideState.acceptInvitationState),
|
package/auth/interfaces.d.ts
CHANGED
|
@@ -47,13 +47,18 @@ export interface SingleErrorByRequestData {
|
|
|
47
47
|
isError: boolean;
|
|
48
48
|
traceId?: string;
|
|
49
49
|
}
|
|
50
|
+
interface UserIPData {
|
|
51
|
+
ip?: string;
|
|
52
|
+
countryCode?: string | null;
|
|
53
|
+
loading?: boolean;
|
|
54
|
+
}
|
|
50
55
|
export type ErrorByRequest = Partial<Record<REQUEST_NAME, SingleErrorByRequestData>>;
|
|
51
56
|
export interface AuthState extends Routes, PluginOptions {
|
|
52
57
|
onRedirectTo: (path: string, opts?: RedirectOptions) => void;
|
|
53
58
|
error?: any;
|
|
54
59
|
errorByRequest: ErrorByRequest;
|
|
55
60
|
isAuthenticated: boolean;
|
|
56
|
-
|
|
61
|
+
userIpData?: UserIPData;
|
|
57
62
|
isLoading: boolean;
|
|
58
63
|
keepSessionAlive?: boolean;
|
|
59
64
|
socialLoginOptions?: {
|
package/index.js
CHANGED
|
@@ -987,14 +987,29 @@ var _default = (store, api, sharedActions) => {
|
|
|
987
987
|
callback
|
|
988
988
|
} = payload;
|
|
989
989
|
try {
|
|
990
|
+
actions.setAuthState({
|
|
991
|
+
userIpData: {
|
|
992
|
+
loading: true
|
|
993
|
+
}
|
|
994
|
+
});
|
|
990
995
|
const {
|
|
991
|
-
ip
|
|
996
|
+
ip,
|
|
997
|
+
country_code
|
|
992
998
|
} = await api.metadata.getCurrentUserIpMetadata();
|
|
993
999
|
actions.setAuthState({
|
|
994
|
-
|
|
1000
|
+
userIpData: {
|
|
1001
|
+
ip,
|
|
1002
|
+
countryCode: country_code,
|
|
1003
|
+
loading: false
|
|
1004
|
+
}
|
|
995
1005
|
});
|
|
996
1006
|
callback == null ? void 0 : callback(true);
|
|
997
1007
|
} catch (e) {
|
|
1008
|
+
actions.setAuthState({
|
|
1009
|
+
userIpData: {
|
|
1010
|
+
loading: false
|
|
1011
|
+
}
|
|
1012
|
+
});
|
|
998
1013
|
callback == null ? void 0 : callback(false);
|
|
999
1014
|
}
|
|
1000
1015
|
};
|
|
@@ -252,8 +252,8 @@ var _default = (store, api, sharedActions) => {
|
|
|
252
252
|
error: null
|
|
253
253
|
});
|
|
254
254
|
try {
|
|
255
|
-
var _store$auth$
|
|
256
|
-
const userIp = (_store$auth$
|
|
255
|
+
var _store$auth$userIpDat, _store$auth$userIpDat2;
|
|
256
|
+
const userIp = (_store$auth$userIpDat = (_store$auth$userIpDat2 = store.auth.userIpData) == null ? void 0 : _store$auth$userIpDat2.ip) != null ? _store$auth$userIpDat : '';
|
|
257
257
|
await Promise.all([api.auth.createIPRestriction({
|
|
258
258
|
ip: userIp,
|
|
259
259
|
isActive: true,
|
package/node/auth/index.js
CHANGED
|
@@ -11,6 +11,41 @@ var _exportNames = {
|
|
|
11
11
|
exports.createAuthState = exports.buildAuthActions = void 0;
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
14
|
+
var _AcceptInvitationState = require("./AcceptInvitationState");
|
|
15
|
+
var _AccountSettingsState = require("./AccountSettingsState");
|
|
16
|
+
var _ActivateAccountState = require("./ActivateAccountState");
|
|
17
|
+
var _UnlockAccountState = require("./UnlockAccountState");
|
|
18
|
+
var _ApiTokensState = require("./ApiTokensState");
|
|
19
|
+
var _ApplicationsState = require("./ApplicationsState");
|
|
20
|
+
var _CustomLoginState = require("./CustomLoginState");
|
|
21
|
+
var _ForgotPasswordState = require("./ForgotPasswordState");
|
|
22
|
+
var _GroupsState = require("./GroupsState");
|
|
23
|
+
var _GroupsDialogsState = require("./GroupsDialogsState");
|
|
24
|
+
var _ImpersonateState = require("./ImpersonateState");
|
|
25
|
+
var _LoginState = require("./LoginState");
|
|
26
|
+
var _MfaState = require("./MfaState");
|
|
27
|
+
var _MSP = require("./MSP");
|
|
28
|
+
var _PasskeysState = require("./PasskeysState");
|
|
29
|
+
var _ProfileState = require("./ProfileState");
|
|
30
|
+
var _ProvisioningState = require("./ProvisioningState");
|
|
31
|
+
var _ResetPhoneNumberState = require("./ResetPhoneNumberState");
|
|
32
|
+
var _RolesState = require("./RolesState");
|
|
33
|
+
var _RestrictionsState = require("./Security/RestrictionsState");
|
|
34
|
+
var _SecurityCenterState = require("./Security/SecurityCenterState");
|
|
35
|
+
var _SecurityPolicyState = require("./Security/SecurityPolicyState");
|
|
36
|
+
var _SessionsPolicyState = require("./Security/SessionsPolicyState");
|
|
37
|
+
var _SessionsState = require("./SessionsState");
|
|
38
|
+
var _SignUpState = require("./SignUpState");
|
|
39
|
+
var _SmsState = require("./SmsState");
|
|
40
|
+
var _SocialLoginState = require("./SocialLoginState");
|
|
41
|
+
var _SSOState = require("./SSOState");
|
|
42
|
+
var _StepUpState = require("./StepUpState");
|
|
43
|
+
var _TeamState = require("./TeamState");
|
|
44
|
+
var _TenantsState = require("./TenantsState");
|
|
45
|
+
var _consts = require("./LoginState/consts");
|
|
46
|
+
var _helpers = require("../helpers");
|
|
47
|
+
var _Entitlements = require("./Entitlements");
|
|
48
|
+
var _proxy = require("../toolkit/proxy");
|
|
14
49
|
var _interfaces = require("./AcceptInvitationState/interfaces");
|
|
15
50
|
Object.keys(_interfaces).forEach(function (key) {
|
|
16
51
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -107,15 +142,15 @@ Object.keys(_interfaces8).forEach(function (key) {
|
|
|
107
142
|
}
|
|
108
143
|
});
|
|
109
144
|
});
|
|
110
|
-
var
|
|
111
|
-
Object.keys(
|
|
145
|
+
var _helpers2 = require("./Entitlements/helpers");
|
|
146
|
+
Object.keys(_helpers2).forEach(function (key) {
|
|
112
147
|
if (key === "default" || key === "__esModule") return;
|
|
113
148
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
114
|
-
if (key in exports && exports[key] ===
|
|
149
|
+
if (key in exports && exports[key] === _helpers2[key]) return;
|
|
115
150
|
Object.defineProperty(exports, key, {
|
|
116
151
|
enumerable: true,
|
|
117
152
|
get: function () {
|
|
118
|
-
return
|
|
153
|
+
return _helpers2[key];
|
|
119
154
|
}
|
|
120
155
|
});
|
|
121
156
|
});
|
|
@@ -419,41 +454,6 @@ Object.keys(_interfaces33).forEach(function (key) {
|
|
|
419
454
|
}
|
|
420
455
|
});
|
|
421
456
|
});
|
|
422
|
-
var _AcceptInvitationState = require("./AcceptInvitationState");
|
|
423
|
-
var _AccountSettingsState = require("./AccountSettingsState");
|
|
424
|
-
var _ActivateAccountState = require("./ActivateAccountState");
|
|
425
|
-
var _UnlockAccountState = require("./UnlockAccountState");
|
|
426
|
-
var _ApiTokensState = require("./ApiTokensState");
|
|
427
|
-
var _ApplicationsState = require("./ApplicationsState");
|
|
428
|
-
var _CustomLoginState = require("./CustomLoginState");
|
|
429
|
-
var _ForgotPasswordState = require("./ForgotPasswordState");
|
|
430
|
-
var _GroupsState = require("./GroupsState");
|
|
431
|
-
var _GroupsDialogsState = require("./GroupsDialogsState");
|
|
432
|
-
var _ImpersonateState = require("./ImpersonateState");
|
|
433
|
-
var _LoginState = require("./LoginState");
|
|
434
|
-
var _MfaState = require("./MfaState");
|
|
435
|
-
var _MSP = require("./MSP");
|
|
436
|
-
var _PasskeysState = require("./PasskeysState");
|
|
437
|
-
var _ProfileState = require("./ProfileState");
|
|
438
|
-
var _ProvisioningState = require("./ProvisioningState");
|
|
439
|
-
var _ResetPhoneNumberState = require("./ResetPhoneNumberState");
|
|
440
|
-
var _RolesState = require("./RolesState");
|
|
441
|
-
var _RestrictionsState = require("./Security/RestrictionsState");
|
|
442
|
-
var _SecurityCenterState = require("./Security/SecurityCenterState");
|
|
443
|
-
var _SecurityPolicyState = require("./Security/SecurityPolicyState");
|
|
444
|
-
var _SessionsPolicyState = require("./Security/SessionsPolicyState");
|
|
445
|
-
var _SessionsState = require("./SessionsState");
|
|
446
|
-
var _SignUpState = require("./SignUpState");
|
|
447
|
-
var _SmsState = require("./SmsState");
|
|
448
|
-
var _SocialLoginState = require("./SocialLoginState");
|
|
449
|
-
var _SSOState = require("./SSOState");
|
|
450
|
-
var _StepUpState = require("./StepUpState");
|
|
451
|
-
var _TeamState = require("./TeamState");
|
|
452
|
-
var _TenantsState = require("./TenantsState");
|
|
453
|
-
var _consts = require("./LoginState/consts");
|
|
454
|
-
var _helpers2 = require("../helpers");
|
|
455
|
-
var _Entitlements = require("./Entitlements");
|
|
456
|
-
var _proxy = require("../toolkit/proxy");
|
|
457
457
|
const _excluded = ["routes"],
|
|
458
458
|
_excluded2 = ["requestName"];
|
|
459
459
|
const createAuthState = _overrideState => {
|
|
@@ -471,7 +471,9 @@ const createAuthState = _overrideState => {
|
|
|
471
471
|
user: null,
|
|
472
472
|
error: undefined,
|
|
473
473
|
errorByRequest: {},
|
|
474
|
-
|
|
474
|
+
userIpData: {
|
|
475
|
+
loading: false
|
|
476
|
+
}
|
|
475
477
|
}, overrideState, {
|
|
476
478
|
// nested states
|
|
477
479
|
acceptInvitationState: (0, _AcceptInvitationState.createAcceptInvitationState)(overrideState == null ? void 0 : overrideState.acceptInvitationState),
|
|
@@ -513,7 +515,7 @@ const buildAuthActions = (store, api, actions, snapshotAuthState) => {
|
|
|
513
515
|
const setAuthState = state => {
|
|
514
516
|
Object.keys(state).forEach(key => {
|
|
515
517
|
const authKey = key;
|
|
516
|
-
if ((0,
|
|
518
|
+
if ((0, _helpers.isProxy)(store.auth[authKey])) {
|
|
517
519
|
Object.assign(store.auth[authKey], state[authKey]);
|
|
518
520
|
} else {
|
|
519
521
|
store.auth[authKey] = state[authKey];
|
|
@@ -521,7 +523,7 @@ const buildAuthActions = (store, api, actions, snapshotAuthState) => {
|
|
|
521
523
|
});
|
|
522
524
|
};
|
|
523
525
|
const resetAuthState = () => {
|
|
524
|
-
(0,
|
|
526
|
+
(0, _helpers.deepResetState)(store, ['auth'], snapshotAuthState);
|
|
525
527
|
};
|
|
526
528
|
const setUser = user => {
|
|
527
529
|
setAuthState({
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.41.0-alpha.0",
|
|
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.
|
|
10
|
+
"@frontegg/rest-api": "7.41.0-alpha.0",
|
|
11
11
|
"fast-deep-equal": "3.1.3",
|
|
12
12
|
"get-value": "^3.0.1",
|
|
13
13
|
"proxy-compare": "^3.0.0",
|