@frontegg/redux-store 7.57.0-alpha.5 → 7.57.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.
Files changed (32) hide show
  1. package/auth/LoginState/actions/index.js +61 -43
  2. package/auth/LoginState/interfaces.d.ts +6 -0
  3. package/auth/LoginState/interfaces.js +2 -0
  4. package/auth/PasswordRotationState/actions.d.ts +6 -0
  5. package/auth/PasswordRotationState/actions.js +13 -0
  6. package/auth/PasswordRotationState/index.d.ts +3 -0
  7. package/auth/PasswordRotationState/index.js +3 -0
  8. package/auth/PasswordRotationState/interfaces.d.ts +7 -0
  9. package/auth/PasswordRotationState/interfaces.js +5 -0
  10. package/auth/PasswordRotationState/state.d.ts +4 -0
  11. package/auth/PasswordRotationState/state.js +6 -0
  12. package/auth/helpers.d.ts +1 -0
  13. package/auth/helpers.js +14 -4
  14. package/auth/index.d.ts +5 -1
  15. package/auth/index.js +5 -0
  16. package/auth/interfaces.d.ts +5 -0
  17. package/index.js +1 -1
  18. package/mocks/auth-mocks/index.js +4 -1
  19. package/mocks/auth-mocks/passwordRotationActions.mocks.d.ts +6 -0
  20. package/mocks/auth-mocks/passwordRotationActions.mocks.js +9 -0
  21. package/node/auth/LoginState/actions/index.js +60 -42
  22. package/node/auth/LoginState/interfaces.js +2 -0
  23. package/node/auth/PasswordRotationState/actions.js +20 -0
  24. package/node/auth/PasswordRotationState/index.js +20 -0
  25. package/node/auth/PasswordRotationState/interfaces.js +12 -0
  26. package/node/auth/PasswordRotationState/state.js +14 -0
  27. package/node/auth/helpers.js +17 -5
  28. package/node/auth/index.js +40 -24
  29. package/node/index.js +1 -1
  30. package/node/mocks/auth-mocks/index.js +4 -1
  31. package/node/mocks/auth-mocks/passwordRotationActions.mocks.js +16 -0
  32. package/package.json +2 -2
@@ -31,7 +31,7 @@ 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 { isMfaRequired } from '../../helpers';
34
+ import { isMfaRequired, isResetPasswordRequired } from '../../helpers';
35
35
  import { MFAStep } from '../../MfaState/interfaces';
36
36
  import { SamlVendors } from '../../SSOState/interfaces';
37
37
  import { DEFAULT_RETRY_CONFIG } from '../../../constants';
@@ -465,50 +465,68 @@ export default ((store, api, sharedActions) => {
465
465
  preserveQueryParams: true
466
466
  });
467
467
  } else {
468
- const loginState = store.auth.loginState;
469
- const isAuthenticated = !!user.accessToken;
470
- if (user.id) {
471
- localStorage.setItem('userId', user.id);
472
- }
473
- actions.afterAuthenticationStateUpdate({
474
- user,
475
- tenants,
476
- activeTenant
477
- }, {
478
- loginState: {
479
- flow: loginState.flow,
480
- quickLoginToRegister: loginState.quickLoginToRegister,
481
- email,
468
+ const [securityCenterLoginFlows, passwordRotationFlagEnabled] = await actions.getFeatureFlags(['security-center-show-login-flows', 'password-rotation']);
469
+ if (passwordRotationFlagEnabled && isResetPasswordRequired(user, store.root.appName)) {
470
+ console.log('🚀 ~ reset password Required', user);
471
+ setLoginState({
472
+ step: LoginStep.passwordRotationExpired,
482
473
  loading: false,
483
- error: undefined,
484
- mfaToken: user.mfaToken,
485
- step: loginState.flow === LoginFlow.Login ? LoginStep.success : loginState.step,
474
+ resetPasswordToken: user.resetPasswordToken,
475
+ userId: user.userId
476
+ });
477
+ } else {
478
+ const loginState = store.auth.loginState;
479
+ const isAuthenticated = !!user.accessToken;
480
+ if (user.id) {
481
+ localStorage.setItem('userId', user.id);
482
+ }
483
+ actions.afterAuthenticationStateUpdate({
484
+ user,
486
485
  tenants,
487
- tenantsLoading: true,
488
- isBreachedPassword: user.isBreachedPassword
489
- },
490
- isAuthenticated
491
- });
492
- const [securityCenterLoginFlows] = await actions.getFeatureFlags(['security-center-show-login-flows']);
493
- if (loginState.flow === LoginFlow.Login) {
494
- if (securityCenterLoginFlows && user.isBreachedPassword && !isAuthenticated) {
495
- setLoginState({
496
- step: LoginStep.breachedPassword,
497
- loading: false
498
- });
499
- } else {
500
- if (isAuthenticated) {
501
- const shouldShowPrompt = await actions.__shouldShowPromptPasskeys();
502
- if (shouldShowPrompt) {
503
- setLoginState({
504
- step: LoginStep.promptPasskeys,
505
- loading: false
506
- });
507
- onRedirectTo(routes.loginUrl, {
508
- preserveQueryParams: true
509
- });
510
- } else {
511
- await actions.afterAuthNavigation();
486
+ activeTenant
487
+ }, {
488
+ loginState: {
489
+ flow: loginState.flow,
490
+ quickLoginToRegister: loginState.quickLoginToRegister,
491
+ email,
492
+ loading: false,
493
+ error: undefined,
494
+ mfaToken: user.mfaToken,
495
+ step: loginState.flow === LoginFlow.Login ? LoginStep.success : loginState.step,
496
+ tenants,
497
+ tenantsLoading: true,
498
+ isBreachedPassword: user.isBreachedPassword
499
+ },
500
+ isAuthenticated
501
+ });
502
+ if (loginState.flow === LoginFlow.Login) {
503
+ if (securityCenterLoginFlows && user.isBreachedPassword && !isAuthenticated) {
504
+ setLoginState({
505
+ step: LoginStep.breachedPassword,
506
+ loading: false
507
+ });
508
+ } else {
509
+ if (isAuthenticated) {
510
+ const shouldShowPasswordRotationPrompt = user.passwordExpiresIn && user.notificationPeriod && user.passwordExpiresIn <= user.notificationPeriod;
511
+ if (passwordRotationFlagEnabled && shouldShowPasswordRotationPrompt) {
512
+ setLoginState({
513
+ step: LoginStep.passwordRotationNotification,
514
+ loading: false
515
+ });
516
+ } else {
517
+ const shouldShowPromptPasskeys = await actions.__shouldShowPromptPasskeys();
518
+ if (shouldShowPromptPasskeys) {
519
+ setLoginState({
520
+ step: LoginStep.promptPasskeys,
521
+ loading: false
522
+ });
523
+ onRedirectTo(routes.loginUrl, {
524
+ preserveQueryParams: true
525
+ });
526
+ } else {
527
+ await actions.afterAuthNavigation();
528
+ }
529
+ }
512
530
  }
513
531
  }
514
532
  }
@@ -17,6 +17,8 @@ export declare enum LoginStep {
17
17
  'promptPasskeys' = "promptPasskeys",
18
18
  'breachedPassword' = "breachedPassword",
19
19
  'breachedPasswordSuccess' = "breachedPasswordSuccess",
20
+ 'passwordRotationExpired' = "passwordRotationExpired",
21
+ 'passwordRotationNotification' = "passwordRotationNotification",
20
22
  'magicLinkPostLoginSuccess' = "magicLinkPostLoginSuccess"
21
23
  }
22
24
  export declare enum LoginFlow {
@@ -49,6 +51,10 @@ export interface LoginState {
49
51
  quickLoginToRegister?: QuickLoginStrategy;
50
52
  changePhoneId?: string;
51
53
  isBreachedPassword?: boolean;
54
+ resetPasswordToken?: string;
55
+ passwordExpiresIn?: number;
56
+ notificationPeriod?: number;
57
+ userId?: string;
52
58
  }
53
59
  export interface HostedLoginCallback {
54
60
  code: string;
@@ -16,6 +16,8 @@ export let LoginStep;
16
16
  LoginStep["promptPasskeys"] = "promptPasskeys";
17
17
  LoginStep["breachedPassword"] = "breachedPassword";
18
18
  LoginStep["breachedPasswordSuccess"] = "breachedPasswordSuccess";
19
+ LoginStep["passwordRotationExpired"] = "passwordRotationExpired";
20
+ LoginStep["passwordRotationNotification"] = "passwordRotationNotification";
19
21
  LoginStep["magicLinkPostLoginSuccess"] = "magicLinkPostLoginSuccess";
20
22
  })(LoginStep || (LoginStep = {}));
21
23
  export let LoginFlow;
@@ -0,0 +1,6 @@
1
+ import type { FronteggState, RestApi, SharedActions } from '../../interfaces';
2
+ import { PasswordRotationStep } from './interfaces';
3
+ declare const _default: (store: FronteggState, api: RestApi, sharedActions: SharedActions) => {
4
+ setStep: (step: PasswordRotationStep) => void;
5
+ };
6
+ export default _default;
@@ -0,0 +1,13 @@
1
+ export default ((store, api, sharedActions) => {
2
+ const setPasswordRotationState = payload => {
3
+ Object.assign(store.auth.passwordRotationState, payload);
4
+ };
5
+ const setStep = step => {
6
+ setPasswordRotationState({
7
+ step
8
+ });
9
+ };
10
+ return {
11
+ setStep
12
+ };
13
+ });
@@ -0,0 +1,3 @@
1
+ import createPasswordRotationState from './state';
2
+ import buildPasswordRotationActions from './actions';
3
+ export { createPasswordRotationState, buildPasswordRotationActions };
@@ -0,0 +1,3 @@
1
+ import createPasswordRotationState from './state';
2
+ import buildPasswordRotationActions from './actions';
3
+ export { createPasswordRotationState, buildPasswordRotationActions };
@@ -0,0 +1,7 @@
1
+ export declare enum PasswordRotationStep {
2
+ 'success' = "success",
3
+ 'notification' = "notification"
4
+ }
5
+ export interface PasswordRotationState {
6
+ step: PasswordRotationStep;
7
+ }
@@ -0,0 +1,5 @@
1
+ export let PasswordRotationStep;
2
+ (function (PasswordRotationStep) {
3
+ PasswordRotationStep["success"] = "success";
4
+ PasswordRotationStep["notification"] = "notification";
5
+ })(PasswordRotationStep || (PasswordRotationStep = {}));
@@ -0,0 +1,4 @@
1
+ import { PasswordRotationState } from './interfaces';
2
+ export declare const initialState: PasswordRotationState;
3
+ declare const _default: (overrideState?: Partial<PasswordRotationState>) => PasswordRotationState;
4
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { PasswordRotationStep } from './interfaces';
2
+ import { createProxy } from '../../toolkit/proxy';
3
+ export const initialState = {
4
+ step: PasswordRotationStep.notification
5
+ };
6
+ export default (overrideState => createProxy(initialState, overrideState));
package/auth/helpers.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './LoginState/helpers';
5
5
  export * from './StepUpState/helpers';
6
6
  export * from './Entitlements/helpers';
7
7
  export declare const isMfaRequired: (user: ILoginResponse, appName: string) => boolean;
8
+ export declare const isResetPasswordRequired: (user: ILoginResponse, appName: string) => boolean;
8
9
  export declare const mapMetaDataObjectToActions: (obj: any, path?: string[]) => CommitChangeDto[];
9
10
  export declare const getUri: (urlStrategy: FronteggState["root"]["urlStrategy"]) => string;
10
11
  export declare const extractPhoneNumber: ({ phoneNumber, ...rest }: ISignUpUser) => {
package/auth/helpers.js CHANGED
@@ -13,11 +13,21 @@ export const isMfaRequired = (user, appName) => {
13
13
  contextHolder.setAccessToken(null);
14
14
  contextHolder.setUser(null);
15
15
  return true;
16
- } else {
17
- contextHolder.setAccessToken(user.accessToken);
18
- contextHolder.setUser(user);
19
- return false;
20
16
  }
17
+ contextHolder.setAccessToken(user.accessToken);
18
+ contextHolder.setUser(user);
19
+ return false;
20
+ };
21
+ export const isResetPasswordRequired = (user, appName) => {
22
+ const contextHolder = ContextHolder.for(appName);
23
+ if (user.resetPasswordToken) {
24
+ contextHolder.setAccessToken(null);
25
+ console.log('resetPasswordToken: ', user.resetPasswordToken);
26
+ return true;
27
+ }
28
+ contextHolder.setAccessToken(user.accessToken);
29
+ contextHolder.setUser(user);
30
+ return false;
21
31
  };
22
32
  export const mapMetaDataObjectToActions = (obj, path = []) => {
23
33
  return Object.entries(obj).reduce((acc, [key, value]) => {
package/auth/index.d.ts CHANGED
@@ -8,6 +8,7 @@ import { buildApiTokensActions } from './ApiTokensState';
8
8
  import { buildApplicationsActions } from './ApplicationsState';
9
9
  import { buildCustomLoginActions } from './CustomLoginState';
10
10
  import { buildForgotPasswordActions } from './ForgotPasswordState';
11
+ import { buildPasswordRotationActions } from './PasswordRotationState';
11
12
  import { buildGroupsActions } from './GroupsState';
12
13
  import { buildGroupsDialogsActions } from './GroupsDialogsState';
13
14
  import { buildImpersonateActions } from './ImpersonateState';
@@ -42,6 +43,7 @@ export * from './CustomLoginState/interfaces';
42
43
  export * from './Entitlements/interfaces';
43
44
  export * from './Entitlements/helpers';
44
45
  export * from './ForgotPasswordState/interfaces';
46
+ export * from './PasswordRotationState/interfaces';
45
47
  export * from './GroupsState/interfaces';
46
48
  export * from './GroupsDialogsState/interfaces';
47
49
  export * from './ImpersonateState/interfaces';
@@ -77,6 +79,7 @@ export type ApplicationsActions = ReturnType<typeof buildApplicationsActions>;
77
79
  export type CustomLoginActions = ReturnType<typeof buildCustomLoginActions>;
78
80
  export type EntitlementsActions = ReturnType<typeof buildEntitlementsActions>;
79
81
  export type ForgotPasswordActions = ReturnType<typeof buildForgotPasswordActions>;
82
+ export type PasswordRotationActions = ReturnType<typeof buildPasswordRotationActions>;
80
83
  export type GroupsActions = ReturnType<typeof buildGroupsActions>;
81
84
  export type GroupsDialogsActions = ReturnType<typeof buildGroupsDialogsActions>;
82
85
  export type ImpersonateActions = ReturnType<typeof buildImpersonateActions>;
@@ -111,6 +114,7 @@ export type AuthStateActions = {
111
114
  customLoginActions: CustomLoginActions;
112
115
  entitlementsActions: EntitlementsActions;
113
116
  forgotPasswordActions: ForgotPasswordActions;
117
+ passwordRotationActions: PasswordRotationActions;
114
118
  groupsActions: GroupsActions;
115
119
  groupsDialogsActions: GroupsDialogsActions;
116
120
  impersonateActions: ImpersonateActions;
@@ -143,4 +147,4 @@ export type AuthActions = {
143
147
  setErrorByRequestName: (payload: SingleErrorByRequestDataPayload) => void;
144
148
  resetAuthState: () => void;
145
149
  setUser: (user: User | null) => void;
146
- } & AcceptInvitationActions & AccountSettingsActions & UnlockAccountActions & ActivateAccountActions & ApiTokensActions & ApplicationsActions & CustomLoginActions & EntitlementsActions & ForgotPasswordActions & GroupsActions & GroupsDialogsActions & ImpersonateActions & LoginActions & MfaActions & AllAccountsActions & AllAccountsDialogActions & PasskeysActions & ProfileActions & ProvisioningActions & ResetPhoneNumberActions & RolesActions & RestrictionsActions & SecurityCenterActions & SecurityPolicyActions & SessionsPolicyActions & SessionsActions & SignUpActions & SmsActions & SocialLoginActions & SSOActions & StepUpActions & TeamActions & TenantsActions;
150
+ } & AcceptInvitationActions & AccountSettingsActions & UnlockAccountActions & ActivateAccountActions & ApiTokensActions & ApplicationsActions & CustomLoginActions & EntitlementsActions & ForgotPasswordActions & PasswordRotationActions & GroupsActions & GroupsDialogsActions & ImpersonateActions & LoginActions & MfaActions & AllAccountsActions & AllAccountsDialogActions & PasskeysActions & ProfileActions & ProvisioningActions & ResetPhoneNumberActions & RolesActions & RestrictionsActions & SecurityCenterActions & SecurityPolicyActions & SessionsPolicyActions & SessionsActions & SignUpActions & SmsActions & SocialLoginActions & SSOActions & StepUpActions & TeamActions & TenantsActions;
package/auth/index.js CHANGED
@@ -10,6 +10,7 @@ import { buildApiTokensActions, createApiTokensState } from './ApiTokensState';
10
10
  import { buildApplicationsActions, createApplicationsState } from './ApplicationsState';
11
11
  import { buildCustomLoginActions, createCustomLoginState } from './CustomLoginState';
12
12
  import { buildForgotPasswordActions, createForgotPasswordState } from './ForgotPasswordState';
13
+ import { buildPasswordRotationActions, createPasswordRotationState } from './PasswordRotationState';
13
14
  import { buildGroupsActions, createGroupsState } from './GroupsState';
14
15
  import { buildGroupsDialogsActions, createGroupsDialogsState } from './GroupsDialogsState';
15
16
  import { buildImpersonateActions, createImpersonateState } from './ImpersonateState';
@@ -47,6 +48,7 @@ export * from './CustomLoginState/interfaces';
47
48
  export * from './Entitlements/interfaces';
48
49
  export * from './Entitlements/helpers';
49
50
  export * from './ForgotPasswordState/interfaces';
51
+ export * from './PasswordRotationState/interfaces';
50
52
  export * from './GroupsState/interfaces';
51
53
  export * from './GroupsDialogsState/interfaces';
52
54
  export * from './ImpersonateState/interfaces';
@@ -100,6 +102,7 @@ export const createAuthState = _overrideState => {
100
102
  applicationsState: createApplicationsState(overrideState == null ? void 0 : overrideState.applicationsState),
101
103
  customLoginState: createCustomLoginState(overrideState == null ? void 0 : overrideState.customLoginState),
102
104
  forgotPasswordState: createForgotPasswordState(overrideState == null ? void 0 : overrideState.forgotPasswordState),
105
+ passwordRotationState: createPasswordRotationState(overrideState == null ? void 0 : overrideState.passwordRotationState),
103
106
  groupsState: createGroupsState(overrideState == null ? void 0 : overrideState.groupsState),
104
107
  groupsDialogsState: createGroupsDialogsState(overrideState == null ? void 0 : overrideState.groupsDialogsState),
105
108
  impersonateState: createImpersonateState(overrideState == null ? void 0 : overrideState.impersonateState),
@@ -165,6 +168,7 @@ export const buildAuthActions = (store, api, actions, snapshotAuthState) => {
165
168
  const customLoginActions = buildCustomLoginActions(store, api, actions);
166
169
  const entitlementsActions = buildEntitlementsActions(store, api, actions);
167
170
  const forgotPasswordActions = buildForgotPasswordActions(store, api, actions);
171
+ const passwordRotationActions = buildPasswordRotationActions(store, api, actions);
168
172
  const groupsActions = buildGroupsActions(store, api, actions);
169
173
  const groupsDialogsActions = buildGroupsDialogsActions(store, api, actions);
170
174
  const impersonateActions = buildImpersonateActions(store, api, actions);
@@ -199,6 +203,7 @@ export const buildAuthActions = (store, api, actions, snapshotAuthState) => {
199
203
  customLoginActions,
200
204
  entitlementsActions,
201
205
  forgotPasswordActions,
206
+ passwordRotationActions,
202
207
  groupsActions,
203
208
  groupsDialogsActions,
204
209
  impersonateActions,
@@ -30,6 +30,7 @@ import type { TenantsState } from './TenantsState/interfaces';
30
30
  import type { IAllAccountsDialogsState, IAllAccountsState } from './MSP/interfaces';
31
31
  import { ApplicationsState } from './ApplicationsState/interfaces';
32
32
  import { UnlockAccountState } from './UnlockAccountState/interfaces';
33
+ import { PasswordRotationState } from '../toolkit';
33
34
  export declare enum REQUEST_NAME {
34
35
  LOAD_FEATURE_FLAGS = "LOAD_FEATURE_FLAGS,",
35
36
  LOAD_ADMIN_BOX_METADATA = "LOAD_ADMIN_BOX_METADATA,",
@@ -80,6 +81,7 @@ export interface AuthState extends Routes, PluginOptions {
80
81
  apiTokensState: ApiTokensState;
81
82
  customLoginState: CustomLoginState;
82
83
  forgotPasswordState: ForgotPasswordState;
84
+ passwordRotationState: PasswordRotationState;
83
85
  groupsState: GroupsState;
84
86
  groupsDialogsState: GroupsDialogsState;
85
87
  impersonateState: ImpersonateState;
@@ -124,6 +126,9 @@ export interface User extends IUserProfile {
124
126
  amr?: string[];
125
127
  acr?: string;
126
128
  auth_time?: number;
129
+ resetToken?: string;
130
+ passwordExpiresIn?: number;
131
+ notificationPeriod?: number;
127
132
  }
128
133
  export interface Routes {
129
134
  routes: AuthPageRoutes;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.57.0-alpha.5
1
+ /** @license Frontegg v7.57.0-alpha.6
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.
@@ -12,6 +12,7 @@ import buildApplicationsActions from './applicationsActions.mocks';
12
12
  import buildCustomLoginActions from './customLoginActions.mocks';
13
13
  import buildEntitlementsActions from './entitlementsActions.mocks';
14
14
  import buildForgotPasswordActions from './forgotPasswordActions.mocks';
15
+ import buildPasswordRotationActions from './passwordRotationActions.mocks';
15
16
  import buildGroupsActions from './groupsActions.mocks';
16
17
  /* contains reducers only no need to mock */
17
18
  import { buildGroupsDialogsActions } from '../../auth/GroupsDialogsState';
@@ -49,6 +50,7 @@ export const buildAuthActions = (store, api, actions, snapshotAuthState) => {
49
50
  const customLoginActions = buildCustomLoginActions(store, api, actions);
50
51
  const entitlementsActions = buildEntitlementsActions(store, api, actions);
51
52
  const forgotPasswordActions = buildForgotPasswordActions(store, api, actions);
53
+ const passwordRotationActions = buildPasswordRotationActions(store, api, actions);
52
54
  const groupsActions = buildGroupsActions(store, api, actions);
53
55
  const groupsDialogsActions = buildGroupsDialogsActions(store, api, actions);
54
56
  const impersonateActions = buildImpersonateActions(store, api, actions);
@@ -83,6 +85,7 @@ export const buildAuthActions = (store, api, actions, snapshotAuthState) => {
83
85
  customLoginActions,
84
86
  entitlementsActions,
85
87
  forgotPasswordActions,
88
+ passwordRotationActions,
86
89
  groupsActions,
87
90
  groupsDialogsActions,
88
91
  impersonateActions,
@@ -142,7 +145,7 @@ export const buildAuthActions = (store, api, actions, snapshotAuthState) => {
142
145
  setErrorByRequestName,
143
146
  resetAuthState,
144
147
  setUser
145
- }, acceptInvitationActions, accountSettingsActions, activateAccountActions, unlockAccountActions, allAccountsActions, allAccountsDialogActions, apiTokensActions, applicationsActions, customLoginActions, entitlementsActions, forgotPasswordActions, groupsActions, groupsDialogsActions, impersonateActions, loginActions, mfaActions, passkeysActions, profileActions, provisioningActions, resetPhoneNumberActions, restrictionsActions, rolesActions, securityCenterActions, securityPolicyActions, sessionsActions, sessionsPolicyActions, signUpActions, smsActions, socialLoginActions, ssoActions, stepUpActions, teamActions, tenantsActions);
148
+ }, acceptInvitationActions, accountSettingsActions, activateAccountActions, unlockAccountActions, allAccountsActions, allAccountsDialogActions, apiTokensActions, applicationsActions, customLoginActions, entitlementsActions, forgotPasswordActions, passwordRotationActions, groupsActions, groupsDialogsActions, impersonateActions, loginActions, mfaActions, passkeysActions, profileActions, provisioningActions, resetPhoneNumberActions, restrictionsActions, rolesActions, securityCenterActions, securityPolicyActions, sessionsActions, sessionsPolicyActions, signUpActions, smsActions, socialLoginActions, ssoActions, stepUpActions, teamActions, tenantsActions);
146
149
  return {
147
150
  authActions,
148
151
  authStateActions
@@ -0,0 +1,6 @@
1
+ import { FronteggState, RestApi, SharedActions } from '../../interfaces';
2
+ import { PasswordRotationStep } from '../../toolkit';
3
+ declare const _default: (store: FronteggState, api: RestApi, actions: SharedActions) => {
4
+ setStep: (step: PasswordRotationStep) => void;
5
+ };
6
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { buildPasswordRotationActions } from '../../auth/PasswordRotationState';
2
+ import { PasswordRotationStep } from '../../toolkit';
3
+ import { mockActionsExpect } from '../helpers';
4
+ export default ((store, api, actions) => {
5
+ const originalActions = buildPasswordRotationActions(store, api, actions);
6
+ const mockedActions = mockActionsExpect(originalActions, ['setStep']);
7
+ mockedActions.setStep(PasswordRotationStep.success);
8
+ return mockedActions;
9
+ });
@@ -472,50 +472,68 @@ var _default = (store, api, sharedActions) => {
472
472
  preserveQueryParams: true
473
473
  });
474
474
  } else {
475
- const loginState = store.auth.loginState;
476
- const isAuthenticated = !!user.accessToken;
477
- if (user.id) {
478
- localStorage.setItem('userId', user.id);
479
- }
480
- actions.afterAuthenticationStateUpdate({
481
- user,
482
- tenants,
483
- activeTenant
484
- }, {
485
- loginState: {
486
- flow: loginState.flow,
487
- quickLoginToRegister: loginState.quickLoginToRegister,
488
- email,
475
+ const [securityCenterLoginFlows, passwordRotationFlagEnabled] = await actions.getFeatureFlags(['security-center-show-login-flows', 'password-rotation']);
476
+ if (passwordRotationFlagEnabled && (0, _helpers3.isResetPasswordRequired)(user, store.root.appName)) {
477
+ console.log('🚀 ~ reset password Required', user);
478
+ setLoginState({
479
+ step: _interfaces.LoginStep.passwordRotationExpired,
489
480
  loading: false,
490
- error: undefined,
491
- mfaToken: user.mfaToken,
492
- step: loginState.flow === _interfaces.LoginFlow.Login ? _interfaces.LoginStep.success : loginState.step,
481
+ resetPasswordToken: user.resetPasswordToken,
482
+ userId: user.userId
483
+ });
484
+ } else {
485
+ const loginState = store.auth.loginState;
486
+ const isAuthenticated = !!user.accessToken;
487
+ if (user.id) {
488
+ localStorage.setItem('userId', user.id);
489
+ }
490
+ actions.afterAuthenticationStateUpdate({
491
+ user,
493
492
  tenants,
494
- tenantsLoading: true,
495
- isBreachedPassword: user.isBreachedPassword
496
- },
497
- isAuthenticated
498
- });
499
- const [securityCenterLoginFlows] = await actions.getFeatureFlags(['security-center-show-login-flows']);
500
- if (loginState.flow === _interfaces.LoginFlow.Login) {
501
- if (securityCenterLoginFlows && user.isBreachedPassword && !isAuthenticated) {
502
- setLoginState({
503
- step: _interfaces.LoginStep.breachedPassword,
504
- loading: false
505
- });
506
- } else {
507
- if (isAuthenticated) {
508
- const shouldShowPrompt = await actions.__shouldShowPromptPasskeys();
509
- if (shouldShowPrompt) {
510
- setLoginState({
511
- step: _interfaces.LoginStep.promptPasskeys,
512
- loading: false
513
- });
514
- onRedirectTo(routes.loginUrl, {
515
- preserveQueryParams: true
516
- });
517
- } else {
518
- await actions.afterAuthNavigation();
493
+ activeTenant
494
+ }, {
495
+ loginState: {
496
+ flow: loginState.flow,
497
+ quickLoginToRegister: loginState.quickLoginToRegister,
498
+ email,
499
+ loading: false,
500
+ error: undefined,
501
+ mfaToken: user.mfaToken,
502
+ step: loginState.flow === _interfaces.LoginFlow.Login ? _interfaces.LoginStep.success : loginState.step,
503
+ tenants,
504
+ tenantsLoading: true,
505
+ isBreachedPassword: user.isBreachedPassword
506
+ },
507
+ isAuthenticated
508
+ });
509
+ if (loginState.flow === _interfaces.LoginFlow.Login) {
510
+ if (securityCenterLoginFlows && user.isBreachedPassword && !isAuthenticated) {
511
+ setLoginState({
512
+ step: _interfaces.LoginStep.breachedPassword,
513
+ loading: false
514
+ });
515
+ } else {
516
+ if (isAuthenticated) {
517
+ const shouldShowPasswordRotationPrompt = user.passwordExpiresIn && user.notificationPeriod && user.passwordExpiresIn <= user.notificationPeriod;
518
+ if (passwordRotationFlagEnabled && shouldShowPasswordRotationPrompt) {
519
+ setLoginState({
520
+ step: _interfaces.LoginStep.passwordRotationNotification,
521
+ loading: false
522
+ });
523
+ } else {
524
+ const shouldShowPromptPasskeys = await actions.__shouldShowPromptPasskeys();
525
+ if (shouldShowPromptPasskeys) {
526
+ setLoginState({
527
+ step: _interfaces.LoginStep.promptPasskeys,
528
+ loading: false
529
+ });
530
+ onRedirectTo(routes.loginUrl, {
531
+ preserveQueryParams: true
532
+ });
533
+ } else {
534
+ await actions.afterAuthNavigation();
535
+ }
536
+ }
519
537
  }
520
538
  }
521
539
  }
@@ -29,6 +29,8 @@ exports.LoginStep = LoginStep;
29
29
  LoginStep["promptPasskeys"] = "promptPasskeys";
30
30
  LoginStep["breachedPassword"] = "breachedPassword";
31
31
  LoginStep["breachedPasswordSuccess"] = "breachedPasswordSuccess";
32
+ LoginStep["passwordRotationExpired"] = "passwordRotationExpired";
33
+ LoginStep["passwordRotationNotification"] = "passwordRotationNotification";
32
34
  LoginStep["magicLinkPostLoginSuccess"] = "magicLinkPostLoginSuccess";
33
35
  })(LoginStep || (exports.LoginStep = LoginStep = {}));
34
36
  let LoginFlow;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _default = (store, api, sharedActions) => {
8
+ const setPasswordRotationState = payload => {
9
+ Object.assign(store.auth.passwordRotationState, payload);
10
+ };
11
+ const setStep = step => {
12
+ setPasswordRotationState({
13
+ step
14
+ });
15
+ };
16
+ return {
17
+ setStep
18
+ };
19
+ };
20
+ exports.default = _default;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "buildPasswordRotationActions", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _actions.default;
11
+ }
12
+ });
13
+ Object.defineProperty(exports, "createPasswordRotationState", {
14
+ enumerable: true,
15
+ get: function () {
16
+ return _state.default;
17
+ }
18
+ });
19
+ var _state = _interopRequireDefault(require("./state"));
20
+ var _actions = _interopRequireDefault(require("./actions"));
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PasswordRotationStep = void 0;
7
+ let PasswordRotationStep;
8
+ exports.PasswordRotationStep = PasswordRotationStep;
9
+ (function (PasswordRotationStep) {
10
+ PasswordRotationStep["success"] = "success";
11
+ PasswordRotationStep["notification"] = "notification";
12
+ })(PasswordRotationStep || (exports.PasswordRotationStep = PasswordRotationStep = {}));
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.initialState = exports.default = void 0;
7
+ var _interfaces = require("./interfaces");
8
+ var _proxy = require("../../toolkit/proxy");
9
+ const initialState = {
10
+ step: _interfaces.PasswordRotationStep.notification
11
+ };
12
+ exports.initialState = initialState;
13
+ var _default = overrideState => (0, _proxy.createProxy)(initialState, overrideState);
14
+ exports.default = _default;
@@ -6,12 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  var _exportNames = {
8
8
  isMfaRequired: true,
9
+ isResetPasswordRequired: true,
9
10
  mapMetaDataObjectToActions: true,
10
11
  getUri: true,
11
12
  extractPhoneNumber: true,
12
13
  isAuthRoute: true
13
14
  };
14
- exports.mapMetaDataObjectToActions = exports.isMfaRequired = exports.isAuthRoute = exports.getUri = exports.extractPhoneNumber = void 0;
15
+ exports.mapMetaDataObjectToActions = exports.isResetPasswordRequired = exports.isMfaRequired = exports.isAuthRoute = exports.getUri = exports.extractPhoneNumber = void 0;
15
16
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
16
17
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
17
18
  var _restApi = require("@frontegg/rest-api");
@@ -60,13 +61,24 @@ const isMfaRequired = (user, appName) => {
60
61
  contextHolder.setAccessToken(null);
61
62
  contextHolder.setUser(null);
62
63
  return true;
63
- } else {
64
- contextHolder.setAccessToken(user.accessToken);
65
- contextHolder.setUser(user);
66
- return false;
67
64
  }
65
+ contextHolder.setAccessToken(user.accessToken);
66
+ contextHolder.setUser(user);
67
+ return false;
68
68
  };
69
69
  exports.isMfaRequired = isMfaRequired;
70
+ const isResetPasswordRequired = (user, appName) => {
71
+ const contextHolder = _restApi.ContextHolder.for(appName);
72
+ if (user.resetPasswordToken) {
73
+ contextHolder.setAccessToken(null);
74
+ console.log('resetPasswordToken: ', user.resetPasswordToken);
75
+ return true;
76
+ }
77
+ contextHolder.setAccessToken(user.accessToken);
78
+ contextHolder.setUser(user);
79
+ return false;
80
+ };
81
+ exports.isResetPasswordRequired = isResetPasswordRequired;
70
82
  const mapMetaDataObjectToActions = (obj, path = []) => {
71
83
  return Object.entries(obj).reduce((acc, [key, value]) => {
72
84
  if (typeof value === 'object') {
@@ -19,6 +19,7 @@ var _ApiTokensState = require("./ApiTokensState");
19
19
  var _ApplicationsState = require("./ApplicationsState");
20
20
  var _CustomLoginState = require("./CustomLoginState");
21
21
  var _ForgotPasswordState = require("./ForgotPasswordState");
22
+ var _PasswordRotationState = require("./PasswordRotationState");
22
23
  var _GroupsState = require("./GroupsState");
23
24
  var _GroupsDialogsState = require("./GroupsDialogsState");
24
25
  var _ImpersonateState = require("./ImpersonateState");
@@ -166,7 +167,7 @@ Object.keys(_interfaces9).forEach(function (key) {
166
167
  }
167
168
  });
168
169
  });
169
- var _interfaces10 = require("./GroupsState/interfaces");
170
+ var _interfaces10 = require("./PasswordRotationState/interfaces");
170
171
  Object.keys(_interfaces10).forEach(function (key) {
171
172
  if (key === "default" || key === "__esModule") return;
172
173
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -178,7 +179,7 @@ Object.keys(_interfaces10).forEach(function (key) {
178
179
  }
179
180
  });
180
181
  });
181
- var _interfaces11 = require("./GroupsDialogsState/interfaces");
182
+ var _interfaces11 = require("./GroupsState/interfaces");
182
183
  Object.keys(_interfaces11).forEach(function (key) {
183
184
  if (key === "default" || key === "__esModule") return;
184
185
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -190,7 +191,7 @@ Object.keys(_interfaces11).forEach(function (key) {
190
191
  }
191
192
  });
192
193
  });
193
- var _interfaces12 = require("./ImpersonateState/interfaces");
194
+ var _interfaces12 = require("./GroupsDialogsState/interfaces");
194
195
  Object.keys(_interfaces12).forEach(function (key) {
195
196
  if (key === "default" || key === "__esModule") return;
196
197
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -202,7 +203,7 @@ Object.keys(_interfaces12).forEach(function (key) {
202
203
  }
203
204
  });
204
205
  });
205
- var _interfaces13 = require("./LoginState/interfaces");
206
+ var _interfaces13 = require("./ImpersonateState/interfaces");
206
207
  Object.keys(_interfaces13).forEach(function (key) {
207
208
  if (key === "default" || key === "__esModule") return;
208
209
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -214,7 +215,7 @@ Object.keys(_interfaces13).forEach(function (key) {
214
215
  }
215
216
  });
216
217
  });
217
- var _interfaces14 = require("./MfaState/interfaces");
218
+ var _interfaces14 = require("./LoginState/interfaces");
218
219
  Object.keys(_interfaces14).forEach(function (key) {
219
220
  if (key === "default" || key === "__esModule") return;
220
221
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -226,7 +227,7 @@ Object.keys(_interfaces14).forEach(function (key) {
226
227
  }
227
228
  });
228
229
  });
229
- var _interfaces15 = require("./MSP/interfaces");
230
+ var _interfaces15 = require("./MfaState/interfaces");
230
231
  Object.keys(_interfaces15).forEach(function (key) {
231
232
  if (key === "default" || key === "__esModule") return;
232
233
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -238,7 +239,7 @@ Object.keys(_interfaces15).forEach(function (key) {
238
239
  }
239
240
  });
240
241
  });
241
- var _interfaces16 = require("./PasskeysState/interfaces");
242
+ var _interfaces16 = require("./MSP/interfaces");
242
243
  Object.keys(_interfaces16).forEach(function (key) {
243
244
  if (key === "default" || key === "__esModule") return;
244
245
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -250,7 +251,7 @@ Object.keys(_interfaces16).forEach(function (key) {
250
251
  }
251
252
  });
252
253
  });
253
- var _interfaces17 = require("./ProfileState/interfaces");
254
+ var _interfaces17 = require("./PasskeysState/interfaces");
254
255
  Object.keys(_interfaces17).forEach(function (key) {
255
256
  if (key === "default" || key === "__esModule") return;
256
257
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -262,7 +263,7 @@ Object.keys(_interfaces17).forEach(function (key) {
262
263
  }
263
264
  });
264
265
  });
265
- var _interfaces18 = require("./ProvisioningState/interfaces");
266
+ var _interfaces18 = require("./ProfileState/interfaces");
266
267
  Object.keys(_interfaces18).forEach(function (key) {
267
268
  if (key === "default" || key === "__esModule") return;
268
269
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -274,7 +275,7 @@ Object.keys(_interfaces18).forEach(function (key) {
274
275
  }
275
276
  });
276
277
  });
277
- var _interfaces19 = require("./ResetPhoneNumberState/interfaces");
278
+ var _interfaces19 = require("./ProvisioningState/interfaces");
278
279
  Object.keys(_interfaces19).forEach(function (key) {
279
280
  if (key === "default" || key === "__esModule") return;
280
281
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -286,7 +287,7 @@ Object.keys(_interfaces19).forEach(function (key) {
286
287
  }
287
288
  });
288
289
  });
289
- var _interfaces20 = require("./RolesState/interfaces");
290
+ var _interfaces20 = require("./ResetPhoneNumberState/interfaces");
290
291
  Object.keys(_interfaces20).forEach(function (key) {
291
292
  if (key === "default" || key === "__esModule") return;
292
293
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -298,7 +299,7 @@ Object.keys(_interfaces20).forEach(function (key) {
298
299
  }
299
300
  });
300
301
  });
301
- var _interfaces21 = require("./Security/RestrictionsState/interfaces");
302
+ var _interfaces21 = require("./RolesState/interfaces");
302
303
  Object.keys(_interfaces21).forEach(function (key) {
303
304
  if (key === "default" || key === "__esModule") return;
304
305
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -310,7 +311,7 @@ Object.keys(_interfaces21).forEach(function (key) {
310
311
  }
311
312
  });
312
313
  });
313
- var _interfaces22 = require("./Security/SecurityCenterState/interfaces");
314
+ var _interfaces22 = require("./Security/RestrictionsState/interfaces");
314
315
  Object.keys(_interfaces22).forEach(function (key) {
315
316
  if (key === "default" || key === "__esModule") return;
316
317
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -322,7 +323,7 @@ Object.keys(_interfaces22).forEach(function (key) {
322
323
  }
323
324
  });
324
325
  });
325
- var _interfaces23 = require("./Security/SecurityPolicyState/interfaces");
326
+ var _interfaces23 = require("./Security/SecurityCenterState/interfaces");
326
327
  Object.keys(_interfaces23).forEach(function (key) {
327
328
  if (key === "default" || key === "__esModule") return;
328
329
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -334,7 +335,7 @@ Object.keys(_interfaces23).forEach(function (key) {
334
335
  }
335
336
  });
336
337
  });
337
- var _interfaces24 = require("./Security/SessionsPolicyState/interfaces");
338
+ var _interfaces24 = require("./Security/SecurityPolicyState/interfaces");
338
339
  Object.keys(_interfaces24).forEach(function (key) {
339
340
  if (key === "default" || key === "__esModule") return;
340
341
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -346,7 +347,7 @@ Object.keys(_interfaces24).forEach(function (key) {
346
347
  }
347
348
  });
348
349
  });
349
- var _interfaces25 = require("./SessionsState/interfaces");
350
+ var _interfaces25 = require("./Security/SessionsPolicyState/interfaces");
350
351
  Object.keys(_interfaces25).forEach(function (key) {
351
352
  if (key === "default" || key === "__esModule") return;
352
353
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -358,7 +359,7 @@ Object.keys(_interfaces25).forEach(function (key) {
358
359
  }
359
360
  });
360
361
  });
361
- var _interfaces26 = require("./SignUpState/interfaces");
362
+ var _interfaces26 = require("./SessionsState/interfaces");
362
363
  Object.keys(_interfaces26).forEach(function (key) {
363
364
  if (key === "default" || key === "__esModule") return;
364
365
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -370,7 +371,7 @@ Object.keys(_interfaces26).forEach(function (key) {
370
371
  }
371
372
  });
372
373
  });
373
- var _interfaces27 = require("./SmsState/interfaces");
374
+ var _interfaces27 = require("./SignUpState/interfaces");
374
375
  Object.keys(_interfaces27).forEach(function (key) {
375
376
  if (key === "default" || key === "__esModule") return;
376
377
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -382,7 +383,7 @@ Object.keys(_interfaces27).forEach(function (key) {
382
383
  }
383
384
  });
384
385
  });
385
- var _interfaces28 = require("./SocialLoginState/interfaces");
386
+ var _interfaces28 = require("./SmsState/interfaces");
386
387
  Object.keys(_interfaces28).forEach(function (key) {
387
388
  if (key === "default" || key === "__esModule") return;
388
389
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -394,7 +395,7 @@ Object.keys(_interfaces28).forEach(function (key) {
394
395
  }
395
396
  });
396
397
  });
397
- var _interfaces29 = require("./SSOState/interfaces");
398
+ var _interfaces29 = require("./SocialLoginState/interfaces");
398
399
  Object.keys(_interfaces29).forEach(function (key) {
399
400
  if (key === "default" || key === "__esModule") return;
400
401
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -406,7 +407,7 @@ Object.keys(_interfaces29).forEach(function (key) {
406
407
  }
407
408
  });
408
409
  });
409
- var _interfaces30 = require("./StepUpState/interfaces");
410
+ var _interfaces30 = require("./SSOState/interfaces");
410
411
  Object.keys(_interfaces30).forEach(function (key) {
411
412
  if (key === "default" || key === "__esModule") return;
412
413
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -418,7 +419,7 @@ Object.keys(_interfaces30).forEach(function (key) {
418
419
  }
419
420
  });
420
421
  });
421
- var _interfaces31 = require("./TeamState/interfaces");
422
+ var _interfaces31 = require("./StepUpState/interfaces");
422
423
  Object.keys(_interfaces31).forEach(function (key) {
423
424
  if (key === "default" || key === "__esModule") return;
424
425
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -430,7 +431,7 @@ Object.keys(_interfaces31).forEach(function (key) {
430
431
  }
431
432
  });
432
433
  });
433
- var _interfaces32 = require("./TenantsState/interfaces");
434
+ var _interfaces32 = require("./TeamState/interfaces");
434
435
  Object.keys(_interfaces32).forEach(function (key) {
435
436
  if (key === "default" || key === "__esModule") return;
436
437
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -442,7 +443,7 @@ Object.keys(_interfaces32).forEach(function (key) {
442
443
  }
443
444
  });
444
445
  });
445
- var _interfaces33 = require("./interfaces");
446
+ var _interfaces33 = require("./TenantsState/interfaces");
446
447
  Object.keys(_interfaces33).forEach(function (key) {
447
448
  if (key === "default" || key === "__esModule") return;
448
449
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -454,6 +455,18 @@ Object.keys(_interfaces33).forEach(function (key) {
454
455
  }
455
456
  });
456
457
  });
458
+ var _interfaces34 = require("./interfaces");
459
+ Object.keys(_interfaces34).forEach(function (key) {
460
+ if (key === "default" || key === "__esModule") return;
461
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
462
+ if (key in exports && exports[key] === _interfaces34[key]) return;
463
+ Object.defineProperty(exports, key, {
464
+ enumerable: true,
465
+ get: function () {
466
+ return _interfaces34[key];
467
+ }
468
+ });
469
+ });
457
470
  const _excluded = ["routes"],
458
471
  _excluded2 = ["requestName"];
459
472
  const createAuthState = _overrideState => {
@@ -485,6 +498,7 @@ const createAuthState = _overrideState => {
485
498
  applicationsState: (0, _ApplicationsState.createApplicationsState)(overrideState == null ? void 0 : overrideState.applicationsState),
486
499
  customLoginState: (0, _CustomLoginState.createCustomLoginState)(overrideState == null ? void 0 : overrideState.customLoginState),
487
500
  forgotPasswordState: (0, _ForgotPasswordState.createForgotPasswordState)(overrideState == null ? void 0 : overrideState.forgotPasswordState),
501
+ passwordRotationState: (0, _PasswordRotationState.createPasswordRotationState)(overrideState == null ? void 0 : overrideState.passwordRotationState),
488
502
  groupsState: (0, _GroupsState.createGroupsState)(overrideState == null ? void 0 : overrideState.groupsState),
489
503
  groupsDialogsState: (0, _GroupsDialogsState.createGroupsDialogsState)(overrideState == null ? void 0 : overrideState.groupsDialogsState),
490
504
  impersonateState: (0, _ImpersonateState.createImpersonateState)(overrideState == null ? void 0 : overrideState.impersonateState),
@@ -551,6 +565,7 @@ const buildAuthActions = (store, api, actions, snapshotAuthState) => {
551
565
  const customLoginActions = (0, _CustomLoginState.buildCustomLoginActions)(store, api, actions);
552
566
  const entitlementsActions = (0, _Entitlements.buildEntitlementsActions)(store, api, actions);
553
567
  const forgotPasswordActions = (0, _ForgotPasswordState.buildForgotPasswordActions)(store, api, actions);
568
+ const passwordRotationActions = (0, _PasswordRotationState.buildPasswordRotationActions)(store, api, actions);
554
569
  const groupsActions = (0, _GroupsState.buildGroupsActions)(store, api, actions);
555
570
  const groupsDialogsActions = (0, _GroupsDialogsState.buildGroupsDialogsActions)(store, api, actions);
556
571
  const impersonateActions = (0, _ImpersonateState.buildImpersonateActions)(store, api, actions);
@@ -585,6 +600,7 @@ const buildAuthActions = (store, api, actions, snapshotAuthState) => {
585
600
  customLoginActions,
586
601
  entitlementsActions,
587
602
  forgotPasswordActions,
603
+ passwordRotationActions,
588
604
  groupsActions,
589
605
  groupsDialogsActions,
590
606
  impersonateActions,
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.57.0-alpha.5
1
+ /** @license Frontegg v7.57.0-alpha.6
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.
@@ -17,6 +17,7 @@ var _applicationsActions = _interopRequireDefault(require("./applicationsActions
17
17
  var _customLoginActions = _interopRequireDefault(require("./customLoginActions.mocks"));
18
18
  var _entitlementsActions = _interopRequireDefault(require("./entitlementsActions.mocks"));
19
19
  var _forgotPasswordActions = _interopRequireDefault(require("./forgotPasswordActions.mocks"));
20
+ var _passwordRotationActions = _interopRequireDefault(require("./passwordRotationActions.mocks"));
20
21
  var _groupsActions = _interopRequireDefault(require("./groupsActions.mocks"));
21
22
  var _GroupsDialogsState = require("../../auth/GroupsDialogsState");
22
23
  var _impersonateActions = _interopRequireDefault(require("./impersonateActions.mocks"));
@@ -54,6 +55,7 @@ const buildAuthActions = (store, api, actions, snapshotAuthState) => {
54
55
  const customLoginActions = (0, _customLoginActions.default)(store, api, actions);
55
56
  const entitlementsActions = (0, _entitlementsActions.default)(store, api, actions);
56
57
  const forgotPasswordActions = (0, _forgotPasswordActions.default)(store, api, actions);
58
+ const passwordRotationActions = (0, _passwordRotationActions.default)(store, api, actions);
57
59
  const groupsActions = (0, _groupsActions.default)(store, api, actions);
58
60
  const groupsDialogsActions = (0, _GroupsDialogsState.buildGroupsDialogsActions)(store, api, actions);
59
61
  const impersonateActions = (0, _impersonateActions.default)(store, api, actions);
@@ -88,6 +90,7 @@ const buildAuthActions = (store, api, actions, snapshotAuthState) => {
88
90
  customLoginActions,
89
91
  entitlementsActions,
90
92
  forgotPasswordActions,
93
+ passwordRotationActions,
91
94
  groupsActions,
92
95
  groupsDialogsActions,
93
96
  impersonateActions,
@@ -147,7 +150,7 @@ const buildAuthActions = (store, api, actions, snapshotAuthState) => {
147
150
  setErrorByRequestName,
148
151
  resetAuthState,
149
152
  setUser
150
- }, acceptInvitationActions, accountSettingsActions, activateAccountActions, unlockAccountActions, allAccountsActions, allAccountsDialogActions, apiTokensActions, applicationsActions, customLoginActions, entitlementsActions, forgotPasswordActions, groupsActions, groupsDialogsActions, impersonateActions, loginActions, mfaActions, passkeysActions, profileActions, provisioningActions, resetPhoneNumberActions, restrictionsActions, rolesActions, securityCenterActions, securityPolicyActions, sessionsActions, sessionsPolicyActions, signUpActions, smsActions, socialLoginActions, ssoActions, stepUpActions, teamActions, tenantsActions);
153
+ }, acceptInvitationActions, accountSettingsActions, activateAccountActions, unlockAccountActions, allAccountsActions, allAccountsDialogActions, apiTokensActions, applicationsActions, customLoginActions, entitlementsActions, forgotPasswordActions, passwordRotationActions, groupsActions, groupsDialogsActions, impersonateActions, loginActions, mfaActions, passkeysActions, profileActions, provisioningActions, resetPhoneNumberActions, restrictionsActions, rolesActions, securityCenterActions, securityPolicyActions, sessionsActions, sessionsPolicyActions, signUpActions, smsActions, socialLoginActions, ssoActions, stepUpActions, teamActions, tenantsActions);
151
154
  return {
152
155
  authActions,
153
156
  authStateActions
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _PasswordRotationState = require("../../auth/PasswordRotationState");
8
+ var _toolkit = require("../../toolkit");
9
+ var _helpers = require("../helpers");
10
+ var _default = (store, api, actions) => {
11
+ const originalActions = (0, _PasswordRotationState.buildPasswordRotationActions)(store, api, actions);
12
+ const mockedActions = (0, _helpers.mockActionsExpect)(originalActions, ['setStep']);
13
+ mockedActions.setStep(_toolkit.PasswordRotationStep.success);
14
+ return mockedActions;
15
+ };
16
+ exports.default = _default;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@frontegg/redux-store",
3
- "version": "7.57.0-alpha.5",
3
+ "version": "7.57.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.57.0-alpha.5",
10
+ "@frontegg/rest-api": "7.57.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",