@frontegg/redux-store 7.0.0-alpha.1 → 7.0.0-alpha.10
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/audits/AuditLogsState/actions.d.ts +9 -0
- package/audits/AuditLogsState/actions.js +103 -0
- package/audits/AuditLogsState/index.d.ts +3 -47
- package/audits/AuditLogsState/index.js +3 -39
- package/audits/AuditLogsState/state.d.ts +4 -0
- package/audits/AuditLogsState/state.js +12 -0
- package/audits/AuditsMetadataState/actions.d.ts +8 -0
- package/audits/AuditsMetadataState/actions.js +36 -0
- package/audits/AuditsMetadataState/index.d.ts +3 -35
- package/audits/AuditsMetadataState/index.js +3 -29
- package/audits/AuditsMetadataState/state.d.ts +4 -0
- package/audits/AuditsMetadataState/state.js +5 -0
- package/audits/index.d.ts +19 -39
- package/audits/index.js +11 -21
- package/audits/interfaces.d.ts +2 -0
- package/audits/interfaces.js +2 -0
- package/audits-backward-compatibility/actions.d.ts +12 -0
- package/audits-backward-compatibility/actions.js +256 -0
- package/audits-backward-compatibility/index.d.ts +5 -0
- package/audits-backward-compatibility/index.js +6 -0
- package/audits-backward-compatibility/interfaces.d.ts +60 -0
- package/audits-backward-compatibility/package.json +6 -0
- package/audits-backward-compatibility/state.d.ts +5 -0
- package/audits-backward-compatibility/state.js +24 -0
- package/auth/AcceptInvitationState/actions.d.ts +12 -0
- package/auth/AcceptInvitationState/actions.js +43 -0
- package/auth/AcceptInvitationState/index.d.ts +3 -117
- package/auth/AcceptInvitationState/index.js +3 -31
- package/auth/AcceptInvitationState/state.d.ts +4 -0
- package/auth/AcceptInvitationState/state.js +6 -0
- package/auth/AccountSettingsState/actions.d.ts +23 -0
- package/auth/AccountSettingsState/actions.js +93 -0
- package/auth/AccountSettingsState/index.d.ts +3 -124
- package/auth/AccountSettingsState/index.js +3 -33
- package/auth/AccountSettingsState/state.d.ts +4 -0
- package/auth/AccountSettingsState/state.js +5 -0
- package/auth/ActivateAccountState/actions.d.ts +26 -0
- package/auth/ActivateAccountState/actions.js +192 -0
- package/auth/ActivateAccountState/index.d.ts +3 -0
- package/auth/ActivateAccountState/index.js +3 -0
- package/auth/ActivateAccountState/state.d.ts +4 -0
- package/auth/ActivateAccountState/state.js +11 -0
- package/auth/ApiTokensState/actions.d.ts +16 -0
- package/auth/ApiTokensState/actions.js +371 -0
- package/auth/ApiTokensState/index.d.ts +3 -171
- package/auth/ApiTokensState/index.js +3 -71
- package/auth/ApiTokensState/interfaces.d.ts +4 -1
- package/auth/ApiTokensState/state.d.ts +4 -0
- package/auth/ApiTokensState/state.js +23 -0
- package/auth/ApplicationsState/actions.d.ts +25 -0
- package/auth/ApplicationsState/actions.js +221 -0
- package/auth/ApplicationsState/helpers.d.ts +3 -0
- package/auth/ApplicationsState/helpers.js +13 -0
- package/auth/ApplicationsState/index.d.ts +3 -0
- package/auth/ApplicationsState/index.js +3 -0
- package/auth/ApplicationsState/interfaces.d.ts +12 -0
- package/auth/ApplicationsState/state.d.ts +4 -0
- package/auth/ApplicationsState/state.js +9 -0
- package/auth/CustomLoginState/actions.d.ts +11 -0
- package/auth/CustomLoginState/actions.js +116 -0
- package/auth/CustomLoginState/index.d.ts +3 -119
- package/auth/CustomLoginState/index.js +3 -32
- package/auth/CustomLoginState/state.d.ts +4 -0
- package/auth/CustomLoginState/state.js +6 -0
- package/auth/Entitlements/actions.d.ts +9 -0
- package/auth/Entitlements/actions.js +40 -0
- package/auth/Entitlements/helpers.d.ts +38 -0
- package/auth/Entitlements/helpers.js +66 -0
- package/auth/Entitlements/index.d.ts +6 -2
- package/auth/Entitlements/index.js +6 -3
- package/auth/ForgotPasswordState/actions.d.ts +11 -0
- package/auth/ForgotPasswordState/actions.js +84 -0
- package/auth/ForgotPasswordState/index.d.ts +3 -121
- package/auth/ForgotPasswordState/index.js +3 -40
- package/auth/ForgotPasswordState/interfaces.d.ts +2 -2
- package/auth/ForgotPasswordState/state.d.ts +4 -0
- package/auth/ForgotPasswordState/state.js +9 -0
- package/auth/GroupsDialogsState/actions.d.ts +17 -0
- package/auth/GroupsDialogsState/actions.js +77 -0
- package/auth/GroupsDialogsState/index.d.ts +3 -0
- package/auth/GroupsDialogsState/index.js +3 -0
- package/auth/GroupsDialogsState/interfaces.d.ts +32 -0
- package/auth/GroupsDialogsState/state.d.ts +4 -0
- package/auth/GroupsDialogsState/state.js +25 -0
- package/auth/GroupsState/actions.d.ts +21 -0
- package/auth/GroupsState/actions.js +403 -0
- package/auth/GroupsState/index.d.ts +3 -178
- package/auth/GroupsState/index.js +3 -58
- package/auth/GroupsState/interfaces.d.ts +1 -32
- package/auth/GroupsState/interfaces.js +2 -0
- package/auth/GroupsState/state.d.ts +4 -0
- package/auth/GroupsState/state.js +8 -0
- package/auth/ImpersonateState/actions.d.ts +8 -0
- package/auth/ImpersonateState/actions.js +52 -0
- package/auth/ImpersonateState/index.d.ts +3 -0
- package/auth/ImpersonateState/index.js +3 -0
- package/auth/ImpersonateState/interfaces.d.ts +14 -0
- package/auth/ImpersonateState/state.d.ts +4 -0
- package/auth/ImpersonateState/state.js +7 -0
- package/auth/LoginState/actions/afterAuthNavigation.actions.d.ts +11 -0
- package/auth/LoginState/actions/afterAuthNavigation.actions.js +183 -0
- package/auth/LoginState/actions/handleVerifyMFAResponse.actions.d.ts +8 -0
- package/auth/LoginState/actions/handleVerifyMFAResponse.actions.js +92 -0
- package/auth/LoginState/actions/hostedLoginAuthorize.actions.d.ts +15 -0
- package/auth/LoginState/actions/hostedLoginAuthorize.actions.js +203 -0
- package/auth/LoginState/actions/index.d.ts +79 -0
- package/auth/LoginState/actions/index.js +1298 -0
- package/auth/LoginState/actions/mfaRequiredState.actions.d.ts +11 -0
- package/auth/LoginState/actions/mfaRequiredState.actions.js +63 -0
- package/auth/LoginState/actions/mfaWithAuthenticator.actions.d.ts +8 -0
- package/auth/LoginState/actions/mfaWithAuthenticator.actions.js +137 -0
- package/auth/LoginState/actions/mfaWithEmailCode.actions.d.ts +10 -0
- package/auth/LoginState/actions/mfaWithEmailCode.actions.js +101 -0
- package/auth/LoginState/actions/mfaWithSMS.actions.d.ts +10 -0
- package/auth/LoginState/actions/mfaWithSMS.actions.js +108 -0
- package/auth/LoginState/actions/mfaWithWebAuthn.actions.d.ts +10 -0
- package/auth/LoginState/actions/mfaWithWebAuthn.actions.js +119 -0
- package/auth/LoginState/consts.d.ts +6 -22
- package/auth/LoginState/consts.js +7 -6
- package/auth/LoginState/helpers.d.ts +31 -0
- package/auth/LoginState/helpers.js +131 -0
- package/auth/LoginState/index.d.ts +3 -233
- package/auth/LoginState/index.js +3 -142
- package/auth/LoginState/interfaces.d.ts +29 -1
- package/auth/LoginState/interfaces.js +7 -1
- package/auth/LoginState/state.d.ts +4 -0
- package/auth/LoginState/state.js +10 -0
- package/auth/MSP/actions.d.ts +28 -0
- package/auth/MSP/actions.js +962 -0
- package/auth/MSP/dialogs/actions.d.ts +25 -0
- package/auth/MSP/dialogs/actions.js +124 -0
- package/auth/MSP/dialogs/state.d.ts +4 -0
- package/auth/MSP/dialogs/state.js +76 -0
- package/auth/MSP/helpers/appendChildrenToNode.d.ts +2 -0
- package/auth/MSP/helpers/getAccountsWithUsersCount.d.ts +15 -0
- package/auth/MSP/helpers/getAccountsWithUsersCount.js +21 -0
- package/auth/MSP/helpers/index.d.ts +5 -0
- package/auth/MSP/helpers/index.js +5 -0
- package/auth/MSP/helpers/removeNodeFromTree.d.ts +2 -0
- package/auth/MSP/helpers/updateNodeIsReseller.d.ts +2 -0
- package/auth/MSP/helpers/updateNodeIsReseller.js +14 -0
- package/auth/MSP/helpers/updateNodeName.d.ts +2 -0
- package/auth/MSP/helpers/updateNodeSubAccountAccessType.d.ts +3 -0
- package/auth/MSP/helpers/updateNodeSubAccountAccessType.js +13 -0
- package/auth/MSP/index.d.ts +5 -1
- package/auth/MSP/index.js +5 -1
- package/auth/MSP/interfaces/dialogsStateTypes.d.ts +63 -0
- package/auth/MSP/interfaces/stateTypes.d.ts +114 -0
- package/auth/MSP/interfaces/stateTypes.js +24 -0
- package/auth/MSP/state.d.ts +4 -0
- package/auth/MSP/state.js +38 -0
- package/auth/MfaState/actions.d.ts +24 -0
- package/auth/MfaState/actions.js +431 -0
- package/auth/MfaState/index.d.ts +3 -157
- package/auth/MfaState/index.js +3 -66
- package/auth/MfaState/interfaces.d.ts +5 -4
- package/auth/MfaState/interfaces.js +1 -0
- package/auth/MfaState/state.d.ts +4 -0
- package/auth/MfaState/state.js +8 -0
- package/auth/PasskeysState/actions.d.ts +12 -0
- package/auth/PasskeysState/actions.js +102 -0
- package/auth/PasskeysState/index.d.ts +3 -125
- package/auth/PasskeysState/index.js +3 -33
- package/auth/PasskeysState/state.d.ts +4 -0
- package/auth/PasskeysState/state.js +7 -0
- package/auth/ProfileState/actions.d.ts +11 -0
- package/auth/ProfileState/actions.js +112 -0
- package/auth/ProfileState/index.d.ts +3 -122
- package/auth/ProfileState/index.js +3 -35
- package/auth/ProfileState/state.d.ts +4 -0
- package/auth/ProfileState/state.js +6 -0
- package/auth/ProvisioningState/actions.d.ts +21 -0
- package/auth/ProvisioningState/actions.js +130 -0
- package/auth/ProvisioningState/index.d.ts +3 -0
- package/auth/ProvisioningState/index.js +3 -0
- package/auth/ProvisioningState/state.d.ts +4 -0
- package/auth/ProvisioningState/state.js +5 -0
- package/auth/ResetPhoneNumberState/actions.d.ts +11 -0
- package/auth/ResetPhoneNumberState/actions.js +115 -0
- package/auth/ResetPhoneNumberState/index.d.ts +3 -128
- package/auth/ResetPhoneNumberState/index.js +3 -38
- package/auth/ResetPhoneNumberState/state.d.ts +4 -0
- package/auth/ResetPhoneNumberState/state.js +7 -0
- package/auth/RolesState/actions.d.ts +24 -0
- package/auth/RolesState/actions.js +274 -0
- package/auth/RolesState/index.d.ts +3 -132
- package/auth/RolesState/index.js +3 -48
- package/auth/RolesState/interfaces.d.ts +17 -2
- package/auth/RolesState/interfaces.js +8 -1
- package/auth/RolesState/state.d.ts +4 -0
- package/auth/RolesState/state.js +9 -0
- package/auth/SSOState/actions/actions.v1.d.ts +20 -0
- package/auth/SSOState/actions/actions.v1.js +387 -0
- package/auth/SSOState/actions/actions.v2.d.ts +19 -0
- package/auth/SSOState/actions/actions.v2.js +359 -0
- package/auth/SSOState/actions/index.d.ts +75 -0
- package/auth/SSOState/actions/index.js +6 -0
- package/auth/SSOState/index.d.ts +3 -274
- package/auth/SSOState/index.js +3 -101
- package/auth/SSOState/state.d.ts +4 -0
- package/auth/SSOState/state.js +10 -0
- package/auth/Security/RestrictionsState/actions.d.ts +24 -0
- package/auth/Security/RestrictionsState/actions.js +444 -0
- package/auth/Security/RestrictionsState/index.d.ts +3 -214
- package/auth/Security/RestrictionsState/index.js +3 -63
- package/auth/Security/RestrictionsState/state.d.ts +4 -0
- package/auth/Security/RestrictionsState/state.js +18 -0
- package/auth/Security/SecurityCenterState/actions.d.ts +17 -0
- package/auth/Security/SecurityCenterState/actions.js +308 -0
- package/auth/Security/SecurityCenterState/index.d.ts +3 -156
- package/auth/Security/SecurityCenterState/index.js +3 -81
- package/auth/Security/SecurityCenterState/interfaces.d.ts +28 -1
- package/auth/Security/SecurityCenterState/interfaces.js +10 -1
- package/auth/Security/SecurityCenterState/state.d.ts +4 -0
- package/auth/Security/SecurityCenterState/state.js +40 -0
- package/auth/Security/SecurityPolicyState/actions.d.ts +35 -0
- package/auth/Security/SecurityPolicyState/actions.js +413 -0
- package/auth/Security/SecurityPolicyState/index.d.ts +3 -802
- package/auth/Security/SecurityPolicyState/index.js +3 -90
- package/auth/Security/SecurityPolicyState/interfaces.d.ts +1 -1
- package/auth/Security/SecurityPolicyState/state.d.ts +4 -0
- package/auth/Security/SecurityPolicyState/state.js +37 -0
- package/auth/Security/SessionsPolicyState/actions.d.ts +10 -0
- package/auth/Security/SessionsPolicyState/actions.js +57 -0
- package/auth/Security/SessionsPolicyState/index.d.ts +3 -120
- package/auth/Security/SessionsPolicyState/index.js +3 -32
- package/auth/Security/SessionsPolicyState/state.d.ts +4 -0
- package/auth/Security/SessionsPolicyState/state.js +6 -0
- package/auth/SessionsState/actions.d.ts +14 -0
- package/auth/SessionsState/actions.js +111 -0
- package/auth/SessionsState/index.d.ts +3 -137
- package/auth/SessionsState/index.js +3 -37
- package/auth/SessionsState/interfaces.d.ts +1 -0
- package/auth/SessionsState/state.d.ts +4 -0
- package/auth/SessionsState/state.js +6 -0
- package/auth/SignUpState/actions.d.ts +10 -0
- package/auth/SignUpState/actions.js +146 -0
- package/auth/SignUpState/index.d.ts +3 -0
- package/auth/SignUpState/index.js +3 -0
- package/auth/SignUpState/state.d.ts +4 -0
- package/auth/SignUpState/state.js +10 -0
- package/auth/SmsState/actions.d.ts +15 -0
- package/auth/SmsState/actions.js +181 -0
- package/auth/SmsState/index.d.ts +3 -0
- package/auth/SmsState/index.js +3 -0
- package/auth/SmsState/interfaces.d.ts +10 -0
- package/auth/SmsState/state.d.ts +4 -0
- package/auth/SmsState/state.js +7 -0
- package/auth/SocialLoginState/actions.d.ts +14 -0
- package/auth/SocialLoginState/actions.js +163 -0
- package/auth/SocialLoginState/index.d.ts +3 -0
- package/auth/SocialLoginState/index.js +3 -0
- package/auth/SocialLoginState/state.d.ts +4 -0
- package/auth/SocialLoginState/state.js +7 -0
- package/auth/StepUpState/actions/generateStepUpSession.actions.d.ts +6 -0
- package/auth/StepUpState/actions/generateStepUpSession.actions.js +104 -0
- package/auth/StepUpState/actions/index.d.ts +18 -0
- package/auth/StepUpState/actions/index.js +98 -0
- package/auth/StepUpState/actions/stepUpHostedLogin.actions.d.ts +6 -0
- package/auth/StepUpState/actions/stepUpHostedLogin.actions.js +32 -0
- package/auth/StepUpState/consts.d.ts +21 -0
- package/auth/StepUpState/consts.js +25 -0
- package/auth/StepUpState/helpers.d.ts +29 -0
- package/auth/StepUpState/helpers.js +54 -0
- package/auth/StepUpState/index.d.ts +3 -0
- package/auth/StepUpState/index.js +3 -0
- package/auth/StepUpState/interfaces.d.ts +36 -0
- package/auth/StepUpState/interfaces.js +1 -0
- package/auth/StepUpState/state.d.ts +4 -0
- package/auth/StepUpState/state.js +7 -0
- package/auth/TeamState/actions/activation-link.actions.d.ts +9 -0
- package/auth/TeamState/actions/activation-link.actions.js +84 -0
- package/auth/TeamState/actions/index.d.ts +52 -0
- package/auth/TeamState/actions/index.js +88 -0
- package/auth/TeamState/actions/invitation-link.actions.d.ts +11 -0
- package/auth/TeamState/actions/invitation-link.actions.js +131 -0
- package/auth/TeamState/actions/sub-tenants.actions.d.ts +11 -0
- package/auth/TeamState/actions/sub-tenants.actions.js +214 -0
- package/auth/TeamState/actions/users.actions.d.ts +27 -0
- package/auth/TeamState/actions/users.actions.js +580 -0
- package/auth/TeamState/index.d.ts +3 -211
- package/auth/TeamState/index.js +3 -133
- package/auth/TeamState/interfaces.d.ts +19 -2
- package/auth/TeamState/interfaces.js +2 -0
- package/auth/TeamState/state.d.ts +4 -0
- package/auth/TeamState/state.js +41 -0
- package/auth/TenantsState/actions.d.ts +18 -0
- package/auth/TenantsState/actions.js +109 -0
- package/auth/TenantsState/index.d.ts +3 -136
- package/auth/TenantsState/index.js +3 -42
- package/auth/TenantsState/interfaces.d.ts +3 -1
- package/auth/TenantsState/state.d.ts +4 -0
- package/auth/TenantsState/state.js +8 -0
- package/auth/helpers.d.ts +20 -0
- package/auth/helpers.js +55 -0
- package/auth/index.d.ts +134 -745
- package/auth/index.js +205 -67
- package/auth/interfaces.d.ts +101 -71
- package/auth/interfaces.js +2 -0
- package/connectivity/actions.d.ts +44 -0
- package/connectivity/actions.js +534 -0
- package/connectivity/consts.d.ts +0 -3
- package/connectivity/consts.js +3 -23
- package/connectivity/index.d.ts +4 -40
- package/connectivity/index.js +3 -16
- package/connectivity/interfaces.d.ts +6 -5
- package/connectivity/state.d.ts +4 -0
- package/connectivity/state.js +11 -0
- package/constants.d.ts +2 -6
- package/constants.js +2 -6
- package/helpers/common.d.ts +8 -0
- package/helpers/common.js +44 -0
- package/helpers/converters.d.ts +3 -0
- package/helpers/converters.js +64 -0
- package/helpers/encoders.d.ts +2 -0
- package/helpers/encoders.js +46 -0
- package/helpers/gtm.d.ts +27 -0
- package/helpers/gtm.js +25 -0
- package/helpers/index.d.ts +6 -0
- package/helpers/index.js +6 -0
- package/helpers/package.json +6 -0
- package/helpers/random.d.ts +4 -0
- package/helpers/random.js +28 -0
- package/helpers/sha256.d.ts +21 -0
- package/helpers/sha256.js +424 -0
- package/index.d.ts +11 -12
- package/index.js +13 -11
- package/interfaces.d.ts +80 -6
- package/mocks/audits-mocks/auditLogsActions.mocks.d.ts +13 -0
- package/mocks/audits-mocks/auditLogsActions.mocks.js +52 -0
- package/mocks/audits-mocks/auditsMetadataActions.mocks.d.ts +7 -0
- package/mocks/audits-mocks/auditsMetadataActions.mocks.js +28 -0
- package/mocks/audits-mocks/index.d.ts +15 -0
- package/mocks/audits-mocks/index.js +8 -0
- package/mocks/auth-mocks/acceptInvitationActions.mocks.d.ts +10 -0
- package/mocks/auth-mocks/acceptInvitationActions.mocks.js +6 -0
- package/mocks/auth-mocks/accountSettingsActions.mocks.d.ts +22 -0
- package/mocks/auth-mocks/accountSettingsActions.mocks.js +52 -0
- package/mocks/auth-mocks/activateAccountActions.mocks.d.ts +24 -0
- package/mocks/auth-mocks/activateAccountActions.mocks.js +7 -0
- package/mocks/auth-mocks/allAccountsActions.mocks.d.ts +37 -0
- package/mocks/auth-mocks/allAccountsActions.mocks.js +6 -0
- package/mocks/auth-mocks/apiTokensActions.mocks.d.ts +17 -0
- package/mocks/auth-mocks/apiTokensActions.mocks.js +127 -0
- package/mocks/auth-mocks/applicationsActions.mocks.d.ts +23 -0
- package/mocks/auth-mocks/applicationsActions.mocks.js +7 -0
- package/mocks/auth-mocks/customLoginActions.mocks.d.ts +11 -0
- package/mocks/auth-mocks/customLoginActions.mocks.js +32 -0
- package/mocks/auth-mocks/entitlementsActions.mocks.d.ts +7 -0
- package/mocks/auth-mocks/entitlementsActions.mocks.js +6 -0
- package/mocks/auth-mocks/forgotPasswordActions.mocks.d.ts +10 -0
- package/mocks/auth-mocks/forgotPasswordActions.mocks.js +30 -0
- package/mocks/auth-mocks/groupsActions.mocks.d.ts +33 -0
- package/mocks/auth-mocks/groupsActions.mocks.js +234 -0
- package/mocks/auth-mocks/impersonateActions.mocks.d.ts +7 -0
- package/mocks/auth-mocks/impersonateActions.mocks.js +6 -0
- package/mocks/auth-mocks/index.d.ts +6 -0
- package/mocks/auth-mocks/index.js +130 -0
- package/mocks/auth-mocks/loginActions.mocks.d.ts +77 -0
- package/mocks/auth-mocks/loginActions.mocks.js +39 -0
- package/mocks/auth-mocks/mfaActions.mocks.d.ts +29 -0
- package/mocks/auth-mocks/mfaActions.mocks.js +220 -0
- package/mocks/auth-mocks/passkeysActions.mocks.d.ts +11 -0
- package/mocks/auth-mocks/passkeysActions.mocks.js +6 -0
- package/mocks/auth-mocks/profileActions.mocks.d.ts +10 -0
- package/mocks/auth-mocks/profileActions.mocks.js +67 -0
- package/mocks/auth-mocks/provisioningActions.mocks.d.ts +19 -0
- package/mocks/auth-mocks/provisioningActions.mocks.js +6 -0
- package/mocks/auth-mocks/resetPhoneNumberActions.mocks.d.ts +12 -0
- package/mocks/auth-mocks/resetPhoneNumberActions.mocks.js +6 -0
- package/mocks/auth-mocks/rolesActions.mocks.d.ts +17 -0
- package/mocks/auth-mocks/rolesActions.mocks.js +33 -0
- package/mocks/auth-mocks/security/restrictionsActions.mocks.d.ts +23 -0
- package/mocks/auth-mocks/security/restrictionsActions.mocks.js +248 -0
- package/mocks/auth-mocks/security/securityCenterActions.mocks.d.ts +16 -0
- package/mocks/auth-mocks/security/securityCenterActions.mocks.js +102 -0
- package/mocks/auth-mocks/security/securityPolicyActions.mocks.d.ts +56 -0
- package/mocks/auth-mocks/security/securityPolicyActions.mocks.js +179 -0
- package/mocks/auth-mocks/security/sessionsPolicyActions.mocks.d.ts +10 -0
- package/mocks/auth-mocks/security/sessionsPolicyActions.mocks.js +35 -0
- package/mocks/auth-mocks/sessionsActions.mocks.d.ts +13 -0
- package/mocks/auth-mocks/sessionsActions.mocks.js +44 -0
- package/mocks/auth-mocks/signUpActions.mocks.d.ts +9 -0
- package/mocks/auth-mocks/signUpActions.mocks.js +6 -0
- package/mocks/auth-mocks/smsActions.mocks.d.ts +12 -0
- package/mocks/auth-mocks/smsActions.mocks.js +6 -0
- package/mocks/auth-mocks/socialLoginActions.mocks.d.ts +12 -0
- package/mocks/auth-mocks/socialLoginActions.mocks.js +6 -0
- package/mocks/auth-mocks/ssoActions.mocks.d.ts +77 -0
- package/mocks/auth-mocks/ssoActions.mocks.js +128 -0
- package/mocks/auth-mocks/stepUpActions.mocks.d.ts +15 -0
- package/mocks/auth-mocks/stepUpActions.mocks.js +6 -0
- package/mocks/auth-mocks/teamActions.mocks.d.ts +52 -0
- package/mocks/auth-mocks/teamActions.mocks.js +378 -0
- package/mocks/auth-mocks/tenantsActions.mocks.d.ts +16 -0
- package/mocks/auth-mocks/tenantsActions.mocks.js +18 -0
- package/mocks/connectivity-mocks/index.d.ts +41 -0
- package/mocks/connectivity-mocks/index.js +7 -0
- package/mocks/dummy.d.ts +41 -0
- package/mocks/dummy.js +965 -0
- package/mocks/helpers.d.ts +1 -0
- package/mocks/helpers.js +16 -0
- package/mocks/index.d.ts +68 -0
- package/mocks/index.js +25 -0
- package/mocks/package.json +6 -0
- package/mocks/subscriptions-mocks/billingActions-mocks/index.d.ts +4 -0
- package/mocks/subscriptions-mocks/billingActions-mocks/index.js +17 -0
- package/mocks/subscriptions-mocks/billingActions-mocks/informationActions.mocks.d.ts +8 -0
- package/mocks/subscriptions-mocks/billingActions-mocks/informationActions.mocks.js +36 -0
- package/mocks/subscriptions-mocks/billingActions-mocks/invoicesActions.mocks.d.ts +10 -0
- package/mocks/subscriptions-mocks/billingActions-mocks/invoicesActions.mocks.js +27 -0
- package/mocks/subscriptions-mocks/billingActions-mocks/paymentMethodActions.mocks.d.ts +11 -0
- package/mocks/subscriptions-mocks/billingActions-mocks/paymentMethodActions.mocks.js +20 -0
- package/mocks/subscriptions-mocks/billingActions-mocks/subscriptionActions.mocks.d.ts +14 -0
- package/mocks/subscriptions-mocks/billingActions-mocks/subscriptionActions.mocks.js +21 -0
- package/mocks/subscriptions-mocks/checkoutActions.mocks.d.ts +11 -0
- package/mocks/subscriptions-mocks/checkoutActions.mocks.js +7 -0
- package/mocks/subscriptions-mocks/configActions.mocks.d.ts +7 -0
- package/mocks/subscriptions-mocks/configActions.mocks.js +23 -0
- package/mocks/subscriptions-mocks/index.d.ts +3 -0
- package/mocks/subscriptions-mocks/index.js +23 -0
- package/mocks/subscriptions-mocks/plansActions.mocks.d.ts +7 -0
- package/mocks/subscriptions-mocks/plansActions.mocks.js +28 -0
- package/mocks/subscriptions-mocks/stripeActions.mocks.d.ts +5 -0
- package/mocks/subscriptions-mocks/stripeActions.mocks.js +6 -0
- package/mocks/subscriptions-mocks/vendorPublicConfigActions.mocks.d.ts +9 -0
- package/mocks/subscriptions-mocks/vendorPublicConfigActions.mocks.js +18 -0
- package/mocks/vendor-mocks/index.d.ts +7 -0
- package/mocks/vendor-mocks/index.js +19 -0
- package/node/audits/AuditLogsState/actions.js +111 -0
- package/node/audits/AuditLogsState/index.js +14 -41
- package/node/audits/AuditLogsState/state.js +20 -0
- package/node/audits/AuditsMetadataState/actions.js +43 -0
- package/node/audits/AuditsMetadataState/index.js +14 -31
- package/node/audits/AuditsMetadataState/state.js +13 -0
- package/node/audits/index.js +13 -117
- package/node/audits/interfaces.js +22 -0
- package/node/audits-backward-compatibility/actions.js +265 -0
- package/node/audits-backward-compatibility/index.js +20 -0
- package/node/audits-backward-compatibility/state.js +32 -0
- package/node/auth/AcceptInvitationState/actions.js +50 -0
- package/node/auth/AcceptInvitationState/index.js +15 -33
- package/node/auth/AcceptInvitationState/state.js +14 -0
- package/node/auth/AccountSettingsState/actions.js +101 -0
- package/node/auth/AccountSettingsState/index.js +15 -35
- package/node/auth/AccountSettingsState/state.js +13 -0
- package/node/auth/ActivateAccountState/actions.js +200 -0
- package/node/auth/ActivateAccountState/index.js +20 -0
- package/node/auth/ActivateAccountState/state.js +19 -0
- package/node/auth/ApiTokensState/actions.js +379 -0
- package/node/auth/ApiTokensState/index.js +15 -73
- package/node/auth/ApiTokensState/state.js +31 -0
- package/node/auth/ApplicationsState/actions.js +229 -0
- package/node/auth/ApplicationsState/helpers.js +20 -0
- package/node/auth/ApplicationsState/index.js +20 -0
- package/node/auth/ApplicationsState/state.js +17 -0
- package/node/auth/CustomLoginState/actions.js +124 -0
- package/node/auth/CustomLoginState/index.js +15 -34
- package/node/auth/CustomLoginState/state.js +14 -0
- package/node/auth/Entitlements/actions.js +47 -0
- package/node/auth/Entitlements/helpers.js +77 -0
- package/node/auth/Entitlements/index.js +7 -21
- package/node/auth/ForgotPasswordState/actions.js +92 -0
- package/node/auth/ForgotPasswordState/index.js +15 -42
- package/node/auth/ForgotPasswordState/state.js +17 -0
- package/node/auth/GroupsDialogsState/actions.js +85 -0
- package/node/auth/GroupsDialogsState/index.js +20 -0
- package/node/auth/GroupsDialogsState/state.js +33 -0
- package/node/auth/GroupsState/actions.js +411 -0
- package/node/auth/GroupsState/index.js +15 -61
- package/node/auth/GroupsState/interfaces.js +1 -0
- package/node/auth/GroupsState/state.js +16 -0
- package/node/auth/ImpersonateState/actions.js +60 -0
- package/node/auth/ImpersonateState/index.js +20 -0
- package/node/auth/ImpersonateState/state.js +15 -0
- package/node/auth/LoginState/actions/afterAuthNavigation.actions.js +191 -0
- package/node/auth/LoginState/actions/handleVerifyMFAResponse.actions.js +98 -0
- package/node/auth/LoginState/actions/hostedLoginAuthorize.actions.js +211 -0
- package/node/auth/LoginState/actions/index.js +1304 -0
- package/node/auth/LoginState/actions/mfaRequiredState.actions.js +71 -0
- package/node/auth/LoginState/actions/mfaWithAuthenticator.actions.js +145 -0
- package/node/auth/LoginState/actions/mfaWithEmailCode.actions.js +109 -0
- package/node/auth/LoginState/actions/mfaWithSMS.actions.js +116 -0
- package/node/auth/LoginState/actions/mfaWithWebAuthn.actions.js +127 -0
- package/node/auth/LoginState/consts.js +7 -6
- package/node/auth/LoginState/helpers.js +150 -0
- package/node/auth/LoginState/index.js +11 -146
- package/node/auth/LoginState/interfaces.js +9 -2
- package/node/auth/LoginState/state.js +18 -0
- package/node/auth/MSP/actions.js +970 -0
- package/node/auth/MSP/dialogs/actions.js +132 -0
- package/node/auth/MSP/dialogs/state.js +84 -0
- package/node/auth/MSP/helpers/getAccountsWithUsersCount.js +28 -0
- package/node/auth/MSP/helpers/index.js +60 -0
- package/node/auth/MSP/helpers/updateNodeIsReseller.js +22 -0
- package/node/auth/MSP/helpers/updateNodeSubAccountAccessType.js +21 -0
- package/node/auth/MSP/index.js +29 -11
- package/node/auth/MSP/interfaces/stateTypes.js +29 -0
- package/node/auth/MSP/state.js +46 -0
- package/node/auth/MfaState/actions.js +439 -0
- package/node/auth/MfaState/index.js +15 -68
- package/node/auth/MfaState/interfaces.js +1 -0
- package/node/auth/MfaState/state.js +16 -0
- package/node/auth/PasskeysState/actions.js +109 -0
- package/node/auth/PasskeysState/index.js +15 -35
- package/node/auth/PasskeysState/state.js +15 -0
- package/node/auth/ProfileState/actions.js +120 -0
- package/node/auth/ProfileState/index.js +15 -37
- package/node/auth/ProfileState/state.js +14 -0
- package/node/auth/ProvisioningState/actions.js +138 -0
- package/node/auth/ProvisioningState/index.js +20 -0
- package/node/auth/ProvisioningState/state.js +13 -0
- package/node/auth/ResetPhoneNumberState/actions.js +123 -0
- package/node/auth/ResetPhoneNumberState/index.js +15 -40
- package/node/auth/ResetPhoneNumberState/state.js +15 -0
- package/node/auth/RolesState/actions.js +282 -0
- package/node/auth/RolesState/index.js +15 -50
- package/node/auth/RolesState/interfaces.js +11 -1
- package/node/auth/RolesState/state.js +17 -0
- package/node/auth/SSOState/actions/actions.v1.js +395 -0
- package/node/auth/SSOState/actions/actions.v2.js +367 -0
- package/node/auth/SSOState/actions/index.js +14 -0
- package/node/auth/SSOState/index.js +15 -103
- package/node/auth/SSOState/state.js +18 -0
- package/node/auth/Security/RestrictionsState/actions.js +452 -0
- package/node/auth/Security/RestrictionsState/index.js +14 -64
- package/node/auth/Security/RestrictionsState/state.js +26 -0
- package/node/auth/Security/SecurityCenterState/actions.js +316 -0
- package/node/auth/Security/SecurityCenterState/index.js +14 -82
- package/node/auth/Security/SecurityCenterState/interfaces.js +13 -1
- package/node/auth/Security/SecurityCenterState/state.js +48 -0
- package/node/auth/Security/SecurityPolicyState/actions.js +421 -0
- package/node/auth/Security/SecurityPolicyState/index.js +14 -91
- package/node/auth/Security/SecurityPolicyState/state.js +45 -0
- package/node/auth/Security/SessionsPolicyState/actions.js +65 -0
- package/node/auth/Security/SessionsPolicyState/index.js +15 -34
- package/node/auth/Security/SessionsPolicyState/state.js +14 -0
- package/node/auth/SessionsState/actions.js +118 -0
- package/node/auth/SessionsState/index.js +15 -39
- package/node/auth/SessionsState/state.js +14 -0
- package/node/auth/SignUpState/actions.js +154 -0
- package/node/auth/SignUpState/index.js +20 -0
- package/node/auth/SignUpState/state.js +18 -0
- package/node/auth/SmsState/actions.js +189 -0
- package/node/auth/SmsState/index.js +20 -0
- package/node/auth/SmsState/state.js +15 -0
- package/node/auth/SocialLoginState/actions.js +171 -0
- package/node/auth/SocialLoginState/index.js +20 -0
- package/node/auth/SocialLoginState/state.js +15 -0
- package/node/auth/StepUpState/actions/generateStepUpSession.actions.js +111 -0
- package/node/auth/StepUpState/actions/index.js +106 -0
- package/node/auth/StepUpState/actions/stepUpHostedLogin.actions.js +39 -0
- package/node/auth/StepUpState/consts.js +36 -0
- package/node/auth/StepUpState/helpers.js +63 -0
- package/node/auth/StepUpState/index.js +20 -0
- package/node/auth/StepUpState/interfaces.js +5 -0
- package/node/auth/StepUpState/state.js +15 -0
- package/node/auth/TeamState/actions/activation-link.actions.js +92 -0
- package/node/auth/TeamState/actions/index.js +96 -0
- package/node/auth/TeamState/actions/invitation-link.actions.js +139 -0
- package/node/auth/TeamState/actions/sub-tenants.actions.js +222 -0
- package/node/auth/TeamState/actions/users.actions.js +588 -0
- package/node/auth/TeamState/index.js +14 -134
- package/node/auth/TeamState/interfaces.js +2 -0
- package/node/auth/TeamState/state.js +49 -0
- package/node/auth/TenantsState/actions.js +116 -0
- package/node/auth/TenantsState/index.js +15 -44
- package/node/auth/TenantsState/state.js +16 -0
- package/node/auth/helpers.js +107 -0
- package/node/auth/index.js +237 -422
- package/node/auth/interfaces.js +1 -1
- package/node/connectivity/actions.js +542 -0
- package/node/connectivity/consts.js +4 -28
- package/node/connectivity/index.js +7 -55
- package/node/connectivity/state.js +19 -0
- package/node/constants.js +30 -14
- package/node/helpers/common.js +57 -0
- package/node/helpers/converters.js +73 -0
- package/node/helpers/encoders.js +54 -0
- package/node/helpers/gtm.js +31 -0
- package/node/helpers/index.js +71 -0
- package/node/helpers/random.js +37 -0
- package/node/index.js +90 -72
- package/node/mocks/audits-mocks/auditLogsActions.mocks.js +59 -0
- package/node/mocks/audits-mocks/auditsMetadataActions.mocks.js +35 -0
- package/node/mocks/audits-mocks/index.js +16 -0
- package/node/mocks/auth-mocks/acceptInvitationActions.mocks.js +13 -0
- package/node/mocks/auth-mocks/accountSettingsActions.mocks.js +60 -0
- package/node/mocks/auth-mocks/activateAccountActions.mocks.js +14 -0
- package/node/mocks/auth-mocks/allAccountsActions.mocks.js +13 -0
- package/node/mocks/auth-mocks/apiTokensActions.mocks.js +135 -0
- package/node/mocks/auth-mocks/applicationsActions.mocks.js +14 -0
- package/node/mocks/auth-mocks/customLoginActions.mocks.js +39 -0
- package/node/mocks/auth-mocks/entitlementsActions.mocks.js +13 -0
- package/node/mocks/auth-mocks/forgotPasswordActions.mocks.js +37 -0
- package/node/mocks/auth-mocks/groupsActions.mocks.js +242 -0
- package/node/mocks/auth-mocks/impersonateActions.mocks.js +13 -0
- package/node/mocks/auth-mocks/index.js +140 -0
- package/node/mocks/auth-mocks/loginActions.mocks.js +46 -0
- package/node/mocks/auth-mocks/mfaActions.mocks.js +228 -0
- package/node/mocks/auth-mocks/passkeysActions.mocks.js +13 -0
- package/node/mocks/auth-mocks/profileActions.mocks.js +75 -0
- package/node/mocks/auth-mocks/provisioningActions.mocks.js +13 -0
- package/node/mocks/auth-mocks/resetPhoneNumberActions.mocks.js +13 -0
- package/node/mocks/auth-mocks/rolesActions.mocks.js +40 -0
- package/node/mocks/auth-mocks/security/restrictionsActions.mocks.js +256 -0
- package/node/mocks/auth-mocks/security/securityCenterActions.mocks.js +109 -0
- package/node/mocks/auth-mocks/security/securityPolicyActions.mocks.js +187 -0
- package/node/mocks/auth-mocks/security/sessionsPolicyActions.mocks.js +43 -0
- package/node/mocks/auth-mocks/sessionsActions.mocks.js +51 -0
- package/node/mocks/auth-mocks/signUpActions.mocks.js +13 -0
- package/node/mocks/auth-mocks/smsActions.mocks.js +13 -0
- package/node/mocks/auth-mocks/socialLoginActions.mocks.js +13 -0
- package/node/mocks/auth-mocks/ssoActions.mocks.js +136 -0
- package/node/mocks/auth-mocks/stepUpActions.mocks.js +13 -0
- package/node/mocks/auth-mocks/teamActions.mocks.js +386 -0
- package/node/mocks/auth-mocks/tenantsActions.mocks.js +25 -0
- package/node/mocks/connectivity-mocks/index.js +14 -0
- package/node/mocks/dummy.js +1010 -0
- package/node/mocks/helpers.js +24 -0
- package/node/mocks/index.js +32 -0
- package/node/mocks/subscriptions-mocks/billingActions-mocks/index.js +25 -0
- package/node/mocks/subscriptions-mocks/billingActions-mocks/informationActions.mocks.js +44 -0
- package/node/mocks/subscriptions-mocks/billingActions-mocks/invoicesActions.mocks.js +35 -0
- package/node/mocks/subscriptions-mocks/billingActions-mocks/paymentMethodActions.mocks.js +27 -0
- package/node/mocks/subscriptions-mocks/billingActions-mocks/subscriptionActions.mocks.js +28 -0
- package/node/mocks/subscriptions-mocks/checkoutActions.mocks.js +14 -0
- package/node/mocks/subscriptions-mocks/configActions.mocks.js +30 -0
- package/node/mocks/subscriptions-mocks/index.js +31 -0
- package/node/mocks/subscriptions-mocks/plansActions.mocks.js +36 -0
- package/node/mocks/subscriptions-mocks/stripeActions.mocks.js +13 -0
- package/node/mocks/subscriptions-mocks/vendorPublicConfigActions.mocks.js +25 -0
- package/node/mocks/vendor-mocks/index.js +26 -0
- package/node/subscriptions/Billing/Information/actions.js +96 -0
- package/node/subscriptions/Billing/Information/index.js +13 -28
- package/node/subscriptions/Billing/Information/state.js +15 -0
- package/node/subscriptions/Billing/Invoices/actions.js +80 -0
- package/node/subscriptions/Billing/Invoices/index.js +11 -40
- package/node/subscriptions/Billing/Invoices/state.js +20 -0
- package/node/subscriptions/Billing/PaymentMethod/actions.js +92 -0
- package/node/subscriptions/Billing/PaymentMethod/index.js +11 -37
- package/node/subscriptions/Billing/PaymentMethod/interfaces.js +0 -1
- package/node/subscriptions/Billing/PaymentMethod/state.js +15 -0
- package/node/subscriptions/Billing/Subscription/actions.js +145 -0
- package/node/subscriptions/Billing/Subscription/index.js +11 -38
- package/node/subscriptions/Billing/Subscription/state.js +23 -0
- package/node/subscriptions/Billing/index.js +25 -22
- package/node/subscriptions/Checkout/actions.js +108 -0
- package/node/subscriptions/Checkout/index.js +13 -34
- package/node/subscriptions/Checkout/state.js +16 -0
- package/node/subscriptions/Config/actions.js +69 -0
- package/node/subscriptions/Config/index.js +13 -26
- package/node/subscriptions/Config/state.js +16 -0
- package/node/subscriptions/Plans/actions.js +56 -0
- package/node/subscriptions/Plans/index.js +13 -25
- package/node/subscriptions/Plans/state.js +16 -0
- package/node/subscriptions/Stripe/actions.js +50 -0
- package/node/subscriptions/Stripe/index.js +13 -26
- package/node/subscriptions/Stripe/state.js +15 -0
- package/node/subscriptions/VendorPublicConfig/actions.js +51 -0
- package/node/subscriptions/VendorPublicConfig/index.js +13 -24
- package/node/subscriptions/VendorPublicConfig/state.js +15 -0
- package/node/subscriptions/helpers.js +36 -0
- package/node/subscriptions/index.js +98 -55
- package/node/subscriptions/interfaces.js +20 -77
- package/node/toolkit/FronteggNativeModule.js +64 -0
- package/node/toolkit/index.js +22 -146
- package/node/toolkit/proxy.js +17 -0
- package/node/toolkit/store.js +233 -0
- package/node/vendor/actions.js +46 -0
- package/node/vendor/index.js +7 -55
- package/node/vendor/state.js +13 -0
- package/package.json +6 -5
- package/subscriptions/Billing/Information/actions.d.ts +9 -0
- package/subscriptions/Billing/Information/actions.js +88 -0
- package/subscriptions/Billing/Information/index.d.ts +3 -12
- package/subscriptions/Billing/Information/index.js +3 -26
- package/subscriptions/Billing/Information/interfaces.d.ts +1 -1
- package/subscriptions/Billing/Information/state.d.ts +4 -0
- package/subscriptions/Billing/Information/state.js +7 -0
- package/subscriptions/Billing/Invoices/actions.d.ts +11 -0
- package/subscriptions/Billing/Invoices/actions.js +73 -0
- package/subscriptions/Billing/Invoices/index.d.ts +3 -18
- package/subscriptions/Billing/Invoices/index.js +3 -40
- package/subscriptions/Billing/Invoices/interfaces.d.ts +1 -1
- package/subscriptions/Billing/Invoices/state.d.ts +4 -0
- package/subscriptions/Billing/Invoices/state.js +12 -0
- package/subscriptions/Billing/PaymentMethod/actions.d.ts +12 -0
- package/subscriptions/Billing/PaymentMethod/actions.js +84 -0
- package/subscriptions/Billing/PaymentMethod/index.d.ts +3 -20
- package/subscriptions/Billing/PaymentMethod/index.js +3 -37
- package/subscriptions/Billing/PaymentMethod/interfaces.d.ts +1 -1
- package/subscriptions/Billing/PaymentMethod/interfaces.js +0 -2
- package/subscriptions/Billing/PaymentMethod/state.d.ts +4 -0
- package/subscriptions/Billing/PaymentMethod/state.js +7 -0
- package/subscriptions/Billing/Subscription/actions.d.ts +14 -0
- package/subscriptions/Billing/Subscription/actions.js +138 -0
- package/subscriptions/Billing/Subscription/index.d.ts +3 -16
- package/subscriptions/Billing/Subscription/index.js +3 -38
- package/subscriptions/Billing/Subscription/interfaces.d.ts +0 -3
- package/subscriptions/Billing/Subscription/state.d.ts +4 -0
- package/subscriptions/Billing/Subscription/state.js +15 -0
- package/subscriptions/Billing/index.d.ts +13 -52
- package/subscriptions/Billing/index.js +25 -22
- package/subscriptions/Billing/interfaces.d.ts +4 -10
- package/subscriptions/Billing/interfaces.js +0 -2
- package/subscriptions/Checkout/actions.d.ts +12 -0
- package/subscriptions/Checkout/actions.js +100 -0
- package/subscriptions/Checkout/index.d.ts +3 -14
- package/subscriptions/Checkout/index.js +3 -32
- package/subscriptions/Checkout/interfaces.d.ts +0 -7
- package/subscriptions/Checkout/state.d.ts +4 -0
- package/subscriptions/Checkout/state.js +8 -0
- package/subscriptions/Config/actions.d.ts +8 -0
- package/subscriptions/Config/actions.js +62 -0
- package/subscriptions/Config/index.d.ts +3 -10
- package/subscriptions/Config/index.js +3 -24
- package/subscriptions/Config/interfaces.d.ts +1 -1
- package/subscriptions/Config/state.d.ts +4 -0
- package/subscriptions/Config/state.js +8 -0
- package/subscriptions/Plans/actions.d.ts +8 -0
- package/subscriptions/Plans/actions.js +49 -0
- package/subscriptions/Plans/index.d.ts +3 -10
- package/subscriptions/Plans/index.js +3 -23
- package/subscriptions/Plans/interfaces.d.ts +1 -4
- package/subscriptions/Plans/state.d.ts +4 -0
- package/subscriptions/Plans/state.js +8 -0
- package/subscriptions/Stripe/actions.d.ts +6 -0
- package/subscriptions/Stripe/actions.js +43 -0
- package/subscriptions/Stripe/index.d.ts +3 -11
- package/subscriptions/Stripe/index.js +3 -24
- package/subscriptions/Stripe/state.d.ts +4 -0
- package/subscriptions/Stripe/state.js +7 -0
- package/subscriptions/VendorPublicConfig/actions.d.ts +10 -0
- package/subscriptions/VendorPublicConfig/actions.js +44 -0
- package/subscriptions/VendorPublicConfig/index.d.ts +3 -10
- package/subscriptions/VendorPublicConfig/index.js +3 -22
- package/subscriptions/VendorPublicConfig/state.d.ts +4 -0
- package/subscriptions/VendorPublicConfig/state.js +7 -0
- package/subscriptions/helpers.d.ts +5 -0
- package/subscriptions/helpers.js +28 -0
- package/subscriptions/index.d.ts +28 -106
- package/subscriptions/index.js +40 -17
- package/subscriptions/interfaces.d.ts +56 -22
- package/subscriptions/interfaces.js +16 -8
- package/toolkit/FronteggNativeModule.d.ts +29 -0
- package/toolkit/FronteggNativeModule.js +57 -0
- package/toolkit/index.d.ts +5 -23
- package/toolkit/index.js +3 -128
- package/toolkit/proxy.d.ts +1 -0
- package/toolkit/proxy.js +9 -0
- package/toolkit/store.d.ts +59 -0
- package/toolkit/store.js +198 -0
- package/vendor/actions.d.ts +12 -0
- package/vendor/actions.js +38 -0
- package/vendor/index.d.ts +4 -17
- package/vendor/index.js +3 -16
- package/vendor/interfaces.d.ts +4 -1
- package/vendor/state.d.ts +4 -0
- package/vendor/state.js +5 -0
- package/audits/AuditLogsState/saga.d.ts +0 -2
- package/audits/AuditLogsState/saga.js +0 -153
- package/audits/AuditsMetadataState/saga.d.ts +0 -2
- package/audits/AuditsMetadataState/saga.js +0 -55
- package/audits/backward-compatibility/index.d.ts +0 -4
- package/audits/backward-compatibility/index.js +0 -4
- package/audits/backward-compatibility/initialState.d.ts +0 -2
- package/audits/backward-compatibility/initialState.js +0 -20
- package/audits/backward-compatibility/interfaces.d.ts +0 -55
- package/audits/backward-compatibility/reducer.d.ts +0 -35
- package/audits/backward-compatibility/reducer.js +0 -129
- package/audits/backward-compatibility/saga.d.ts +0 -1
- package/audits/backward-compatibility/saga.js +0 -173
- package/audits/initialState.d.ts +0 -2
- package/audits/initialState.js +0 -6
- package/audits/reducer.d.ts +0 -31
- package/audits/reducer.js +0 -21
- package/audits/saga.d.ts +0 -2
- package/audits/saga.js +0 -9
- package/audits/utils.d.ts +0 -14
- package/audits/utils.js +0 -13
- package/auth/AcceptInvitationState/saga.d.ts +0 -1
- package/auth/AcceptInvitationState/saga.js +0 -39
- package/auth/AccountSettingsState/saga.d.ts +0 -2
- package/auth/AccountSettingsState/saga.js +0 -127
- package/auth/ActivateState/index.d.ts +0 -190
- package/auth/ActivateState/index.js +0 -46
- package/auth/ActivateState/saga.d.ts +0 -1
- package/auth/ActivateState/saga.js +0 -191
- package/auth/ApiTokensState/saga.d.ts +0 -2
- package/auth/ApiTokensState/saga.js +0 -485
- package/auth/CustomLoginState/saga.d.ts +0 -20
- package/auth/CustomLoginState/saga.js +0 -152
- package/auth/CustomLoginState/utils.d.ts +0 -2
- package/auth/CustomLoginState/utils.js +0 -11
- package/auth/Entitlements/saga.d.ts +0 -30
- package/auth/Entitlements/saga.js +0 -51
- package/auth/Entitlements/utils.d.ts +0 -23
- package/auth/Entitlements/utils.js +0 -71
- package/auth/ForgotPasswordState/saga.d.ts +0 -8
- package/auth/ForgotPasswordState/saga.js +0 -81
- package/auth/GroupsState/groupsDialogsState.d.ts +0 -614
- package/auth/GroupsState/groupsDialogsState.js +0 -79
- package/auth/GroupsState/saga.d.ts +0 -2
- package/auth/GroupsState/saga.js +0 -640
- package/auth/Helpers/base64ToFormData.d.ts +0 -1
- package/auth/Helpers/base64ToFormData.js +0 -37
- package/auth/Helpers/index.d.ts +0 -2
- package/auth/Helpers/index.js +0 -2
- package/auth/Helpers/isAuthRoute.d.ts +0 -2
- package/auth/Helpers/isAuthRoute.js +0 -9
- package/auth/ImpersonationState/index.d.ts +0 -117
- package/auth/ImpersonationState/index.js +0 -32
- package/auth/ImpersonationState/interfaces.d.ts +0 -14
- package/auth/ImpersonationState/saga.d.ts +0 -1
- package/auth/ImpersonationState/saga.js +0 -37
- package/auth/LoginState/mfaRequiredState.saga.d.ts +0 -32
- package/auth/LoginState/mfaRequiredState.saga.js +0 -61
- package/auth/LoginState/saga.d.ts +0 -35
- package/auth/LoginState/saga.js +0 -1967
- package/auth/LoginState/utils.d.ts +0 -27
- package/auth/LoginState/utils.js +0 -126
- package/auth/MSP/AllAccountsState/allAccountsDialogsState.d.ts +0 -767
- package/auth/MSP/AllAccountsState/allAccountsDialogsState.js +0 -89
- package/auth/MSP/AllAccountsState/index.d.ts +0 -232
- package/auth/MSP/AllAccountsState/index.js +0 -101
- package/auth/MSP/AllAccountsState/saga.d.ts +0 -3
- package/auth/MSP/AllAccountsState/saga.js +0 -825
- package/auth/MSP/AllAccountsState/types/dialogsStateTypes.d.ts +0 -49
- package/auth/MSP/AllAccountsState/types/stateTypes.d.ts +0 -106
- package/auth/MSP/AllAccountsState/types/stateTypes.js +0 -22
- package/auth/MSP/AllAccountsState/utils/appendChildrenToNode.d.ts +0 -2
- package/auth/MSP/AllAccountsState/utils/getAccountsWithUsersCount.d.ts +0 -13
- package/auth/MSP/AllAccountsState/utils/getAccountsWithUsersCount.js +0 -19
- package/auth/MSP/AllAccountsState/utils/removeNodeFromTree.d.ts +0 -2
- package/auth/MSP/AllAccountsState/utils/updateNodeName.d.ts +0 -2
- package/auth/MfaState/saga.d.ts +0 -2
- package/auth/MfaState/saga.js +0 -673
- package/auth/PasskeysState/helpers.d.ts +0 -2
- package/auth/PasskeysState/helpers.js +0 -8
- package/auth/PasskeysState/saga.d.ts +0 -14
- package/auth/PasskeysState/saga.js +0 -56
- package/auth/ProfileState/saga.d.ts +0 -2
- package/auth/ProfileState/saga.js +0 -178
- package/auth/Provisioning/index.d.ts +0 -128
- package/auth/Provisioning/index.js +0 -37
- package/auth/Provisioning/saga.d.ts +0 -1
- package/auth/Provisioning/saga.js +0 -121
- package/auth/ResetPhoneNumberState/saga.d.ts +0 -17
- package/auth/ResetPhoneNumberState/saga.js +0 -119
- package/auth/RolesState/saga.d.ts +0 -2
- package/auth/RolesState/saga.js +0 -208
- package/auth/SSOState/saga.d.ts +0 -2
- package/auth/SSOState/saga.js +0 -478
- package/auth/SSOState/saga.v2.d.ts +0 -1
- package/auth/SSOState/saga.v2.js +0 -546
- package/auth/Security/RestrictionsState/saga.d.ts +0 -2
- package/auth/Security/RestrictionsState/saga.js +0 -698
- package/auth/Security/SecurityCenterState/saga.d.ts +0 -129
- package/auth/Security/SecurityCenterState/saga.js +0 -419
- package/auth/Security/SecurityCenterState/types.d.ts +0 -28
- package/auth/Security/SecurityCenterState/types.js +0 -10
- package/auth/Security/SecurityPolicyState/saga.d.ts +0 -50
- package/auth/Security/SecurityPolicyState/saga.js +0 -560
- package/auth/Security/SessionsPolicyState/saga.d.ts +0 -2
- package/auth/Security/SessionsPolicyState/saga.js +0 -87
- package/auth/SessionsState/saga.d.ts +0 -2
- package/auth/SessionsState/saga.js +0 -152
- package/auth/SignUp/index.d.ts +0 -118
- package/auth/SignUp/index.js +0 -36
- package/auth/SignUp/saga.d.ts +0 -64
- package/auth/SignUp/saga.js +0 -134
- package/auth/SocialLogins/index.d.ts +0 -123
- package/auth/SocialLogins/index.js +0 -37
- package/auth/SocialLogins/saga.d.ts +0 -11
- package/auth/SocialLogins/saga.js +0 -152
- package/auth/TeamState/saga.d.ts +0 -2
- package/auth/TeamState/saga.js +0 -1278
- package/auth/TenantsState/saga.d.ts +0 -2
- package/auth/TenantsState/saga.js +0 -125
- package/auth/dummy.d.ts +0 -45
- package/auth/dummy.js +0 -590
- package/auth/initialState.d.ts +0 -3
- package/auth/initialState.js +0 -66
- package/auth/reducer.d.ts +0 -720
- package/auth/reducer.js +0 -54
- package/auth/saga.d.ts +0 -2
- package/auth/saga.js +0 -41
- package/auth/utils.d.ts +0 -327
- package/auth/utils.js +0 -159
- package/connectivity/ConnectivityState/index.d.ts +0 -301
- package/connectivity/ConnectivityState/index.js +0 -101
- package/connectivity/reducer.d.ts +0 -31
- package/connectivity/reducer.js +0 -23
- package/connectivity/saga.d.ts +0 -1
- package/connectivity/saga.js +0 -562
- package/fronteggState.d.ts +0 -28
- package/helpers.d.ts +0 -8
- package/helpers.js +0 -56
- package/node/audits/AuditLogsState/saga.js +0 -161
- package/node/audits/AuditsMetadataState/saga.js +0 -62
- package/node/audits/backward-compatibility/index.js +0 -49
- package/node/audits/backward-compatibility/initialState.js +0 -27
- package/node/audits/backward-compatibility/reducer.js +0 -139
- package/node/audits/backward-compatibility/saga.js +0 -180
- package/node/audits/initialState.js +0 -13
- package/node/audits/reducer.js +0 -29
- package/node/audits/saga.js +0 -16
- package/node/audits/utils.js +0 -21
- package/node/auth/AcceptInvitationState/saga.js +0 -45
- package/node/auth/AccountSettingsState/saga.js +0 -135
- package/node/auth/ActivateState/index.js +0 -53
- package/node/auth/ActivateState/saga.js +0 -198
- package/node/auth/ApiTokensState/saga.js +0 -493
- package/node/auth/CustomLoginState/saga.js +0 -163
- package/node/auth/CustomLoginState/utils.js +0 -18
- package/node/auth/Entitlements/saga.js +0 -61
- package/node/auth/Entitlements/utils.js +0 -80
- package/node/auth/ForgotPasswordState/saga.js +0 -89
- package/node/auth/GroupsState/groupsDialogsState.js +0 -87
- package/node/auth/GroupsState/saga.js +0 -648
- package/node/auth/Helpers/base64ToFormData.js +0 -43
- package/node/auth/Helpers/index.js +0 -27
- package/node/auth/Helpers/isAuthRoute.js +0 -17
- package/node/auth/ImpersonationState/index.js +0 -39
- package/node/auth/ImpersonationState/saga.js +0 -44
- package/node/auth/LoginState/mfaRequiredState.saga.js +0 -68
- package/node/auth/LoginState/saga.js +0 -1981
- package/node/auth/LoginState/utils.js +0 -142
- package/node/auth/MSP/AllAccountsState/allAccountsDialogsState.js +0 -96
- package/node/auth/MSP/AllAccountsState/index.js +0 -126
- package/node/auth/MSP/AllAccountsState/saga.js +0 -835
- package/node/auth/MSP/AllAccountsState/types/stateTypes.js +0 -27
- package/node/auth/MSP/AllAccountsState/utils/getAccountsWithUsersCount.js +0 -26
- package/node/auth/MfaState/saga.js +0 -681
- package/node/auth/PasskeysState/helpers.js +0 -15
- package/node/auth/PasskeysState/saga.js +0 -64
- package/node/auth/ProfileState/saga.js +0 -186
- package/node/auth/Provisioning/index.js +0 -44
- package/node/auth/Provisioning/saga.js +0 -128
- package/node/auth/ResetPhoneNumberState/saga.js +0 -127
- package/node/auth/RolesState/saga.js +0 -216
- package/node/auth/SSOState/saga.js +0 -486
- package/node/auth/SSOState/saga.v2.js +0 -553
- package/node/auth/Security/RestrictionsState/saga.js +0 -706
- package/node/auth/Security/SecurityCenterState/saga.js +0 -441
- package/node/auth/Security/SecurityCenterState/types.js +0 -17
- package/node/auth/Security/SecurityPolicyState/saga.js +0 -574
- package/node/auth/Security/SessionsPolicyState/saga.js +0 -95
- package/node/auth/SessionsState/saga.js +0 -159
- package/node/auth/SignUp/index.js +0 -43
- package/node/auth/SignUp/saga.js +0 -144
- package/node/auth/SocialLogins/index.js +0 -44
- package/node/auth/SocialLogins/saga.js +0 -161
- package/node/auth/TeamState/saga.js +0 -1286
- package/node/auth/TenantsState/saga.js +0 -132
- package/node/auth/dummy.js +0 -633
- package/node/auth/initialState.js +0 -75
- package/node/auth/reducer.js +0 -62
- package/node/auth/saga.js +0 -48
- package/node/auth/utils.js +0 -178
- package/node/connectivity/ConnectivityState/index.js +0 -108
- package/node/connectivity/reducer.js +0 -32
- package/node/connectivity/saga.js +0 -567
- package/node/helpers.js +0 -70
- package/node/subscriptions/Billing/Information/saga.js +0 -122
- package/node/subscriptions/Billing/Invoices/saga.js +0 -85
- package/node/subscriptions/Billing/PaymentMethod/saga.js +0 -87
- package/node/subscriptions/Billing/Subscription/loadSubscription.saga.js +0 -26
- package/node/subscriptions/Billing/Subscription/saga.js +0 -101
- package/node/subscriptions/Billing/saga.js +0 -18
- package/node/subscriptions/Checkout/saga.js +0 -116
- package/node/subscriptions/Config/saga.js +0 -65
- package/node/subscriptions/Plans/saga.js +0 -66
- package/node/subscriptions/Stripe/saga.js +0 -37
- package/node/subscriptions/VendorPublicConfig/saga.js +0 -45
- package/node/subscriptions/general.interfaces.js +0 -25
- package/node/subscriptions/mapper.js +0 -40
- package/node/subscriptions/reducer.js +0 -48
- package/node/subscriptions/saga.js +0 -20
- package/node/subscriptions/utils.js +0 -62
- package/node/toolkit/redux-saga-tools.js +0 -56
- package/node/toolkit/redux.js +0 -42
- package/node/utils/gtm.js +0 -29
- package/node/utils/index.js +0 -38
- package/node/vendor/VendorState/index.js +0 -31
- package/node/vendor/reducer.js +0 -26
- package/node/vendor/saga.js +0 -52
- package/subscriptions/Billing/Information/saga.d.ts +0 -34
- package/subscriptions/Billing/Information/saga.js +0 -111
- package/subscriptions/Billing/Invoices/saga.d.ts +0 -13
- package/subscriptions/Billing/Invoices/saga.js +0 -76
- package/subscriptions/Billing/PaymentMethod/saga.d.ts +0 -13
- package/subscriptions/Billing/PaymentMethod/saga.js +0 -78
- package/subscriptions/Billing/Subscription/loadSubscription.saga.d.ts +0 -1
- package/subscriptions/Billing/Subscription/loadSubscription.saga.js +0 -21
- package/subscriptions/Billing/Subscription/saga.d.ts +0 -2
- package/subscriptions/Billing/Subscription/saga.js +0 -94
- package/subscriptions/Billing/saga.d.ts +0 -2
- package/subscriptions/Billing/saga.js +0 -11
- package/subscriptions/Checkout/saga.d.ts +0 -5
- package/subscriptions/Checkout/saga.js +0 -108
- package/subscriptions/Config/saga.d.ts +0 -2
- package/subscriptions/Config/saga.js +0 -58
- package/subscriptions/Plans/saga.d.ts +0 -2
- package/subscriptions/Plans/saga.js +0 -58
- package/subscriptions/Stripe/saga.d.ts +0 -1
- package/subscriptions/Stripe/saga.js +0 -31
- package/subscriptions/VendorPublicConfig/saga.d.ts +0 -2
- package/subscriptions/VendorPublicConfig/saga.js +0 -38
- package/subscriptions/general.interfaces.d.ts +0 -49
- package/subscriptions/general.interfaces.js +0 -16
- package/subscriptions/mapper.d.ts +0 -6
- package/subscriptions/mapper.js +0 -31
- package/subscriptions/reducer.d.ts +0 -99
- package/subscriptions/reducer.js +0 -33
- package/subscriptions/saga.d.ts +0 -2
- package/subscriptions/saga.js +0 -13
- package/subscriptions/utils.d.ts +0 -68
- package/subscriptions/utils.js +0 -52
- package/toolkit/interfaces.d.ts +0 -7
- package/toolkit/redux-saga-tools.d.ts +0 -4
- package/toolkit/redux-saga-tools.js +0 -3
- package/toolkit/redux-types.d.ts +0 -3
- package/toolkit/redux.d.ts +0 -4
- package/toolkit/redux.js +0 -1
- package/utils/gtm.d.ts +0 -28
- package/utils/gtm.js +0 -22
- package/utils/index.d.ts +0 -3
- package/utils/index.js +0 -3
- package/utils/package.json +0 -6
- package/utils/sha256.d.ts +0 -22
- package/utils/sha256.js +0 -425
- package/vendor/VendorState/index.d.ts +0 -21
- package/vendor/VendorState/index.js +0 -24
- package/vendor/reducer.d.ts +0 -8
- package/vendor/reducer.js +0 -17
- package/vendor/saga.d.ts +0 -8
- package/vendor/saga.js +0 -44
- /package/{audits/backward-compatibility → audits-backward-compatibility}/interfaces.js +0 -0
- /package/auth/{ActivateState → ActivateAccountState}/interfaces.d.ts +0 -0
- /package/auth/{ActivateState → ActivateAccountState}/interfaces.js +0 -0
- /package/auth/{Provisioning → ApplicationsState}/interfaces.js +0 -0
- /package/auth/{SocialLogins → GroupsDialogsState}/interfaces.js +0 -0
- /package/auth/{ImpersonationState → ImpersonateState}/interfaces.js +0 -0
- /package/auth/MSP/{AllAccountsState/utils → helpers}/appendChildrenToNode.js +0 -0
- /package/auth/MSP/{AllAccountsState/utils → helpers}/removeNodeFromTree.js +0 -0
- /package/auth/MSP/{AllAccountsState/utils → helpers}/updateNodeName.js +0 -0
- /package/auth/MSP/{AllAccountsState/types → interfaces}/dialogsStateTypes.js +0 -0
- /package/auth/MSP/{AllAccountsState/types → interfaces}/index.d.ts +0 -0
- /package/auth/MSP/{AllAccountsState/types → interfaces}/index.js +0 -0
- /package/auth/{Provisioning → ProvisioningState}/interfaces.d.ts +0 -0
- /package/{toolkit → auth/ProvisioningState}/interfaces.js +0 -0
- /package/auth/{SignUp → SignUpState}/interfaces.d.ts +0 -0
- /package/auth/{SignUp → SignUpState}/interfaces.js +0 -0
- /package/{fronteggState.js → auth/SmsState/interfaces.js} +0 -0
- /package/auth/{SocialLogins → SocialLoginState}/interfaces.d.ts +0 -0
- /package/{toolkit/redux-types.js → auth/SocialLoginState/interfaces.js} +0 -0
- /package/{utils/errorHandler.d.ts → helpers/handlers.d.ts} +0 -0
- /package/{utils/errorHandler.js → helpers/handlers.js} +0 -0
- /package/{audits → mocks/audits-mocks}/dummy.d.ts +0 -0
- /package/{audits → mocks/audits-mocks}/dummy.js +0 -0
- /package/{subscriptions → mocks/subscriptions-mocks}/dummy.d.ts +0 -0
- /package/{subscriptions → mocks/subscriptions-mocks}/dummy.js +0 -0
- /package/node/{audits/backward-compatibility → audits-backward-compatibility}/interfaces.js +0 -0
- /package/node/auth/{ActivateState → ActivateAccountState}/interfaces.js +0 -0
- /package/node/auth/{Provisioning → ApplicationsState}/interfaces.js +0 -0
- /package/node/auth/{SocialLogins → GroupsDialogsState}/interfaces.js +0 -0
- /package/node/auth/{ImpersonationState → ImpersonateState}/interfaces.js +0 -0
- /package/node/auth/MSP/{AllAccountsState/utils → helpers}/appendChildrenToNode.js +0 -0
- /package/node/auth/MSP/{AllAccountsState/utils → helpers}/removeNodeFromTree.js +0 -0
- /package/node/auth/MSP/{AllAccountsState/utils → helpers}/updateNodeName.js +0 -0
- /package/node/auth/MSP/{AllAccountsState/types → interfaces}/dialogsStateTypes.js +0 -0
- /package/node/auth/MSP/{AllAccountsState/types → interfaces}/index.js +0 -0
- /package/node/{toolkit → auth/ProvisioningState}/interfaces.js +0 -0
- /package/node/auth/{SignUp → SignUpState}/interfaces.js +0 -0
- /package/node/{fronteggState.js → auth/SmsState/interfaces.js} +0 -0
- /package/node/{toolkit/redux-types.js → auth/SocialLoginState/interfaces.js} +0 -0
- /package/node/{utils/errorHandler.js → helpers/handlers.js} +0 -0
- /package/node/{utils → helpers}/sha256.js +0 -0
- /package/node/{audits → mocks/audits-mocks}/dummy.js +0 -0
- /package/node/{subscriptions → mocks/subscriptions-mocks}/dummy.js +0 -0
|
@@ -0,0 +1,1304 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _afterAuthNavigation = _interopRequireDefault(require("./afterAuthNavigation.actions"));
|
|
11
|
+
var _handleVerifyMFAResponse = _interopRequireDefault(require("./handleVerifyMFAResponse.actions"));
|
|
12
|
+
var _mfaRequiredState = _interopRequireDefault(require("./mfaRequiredState.actions"));
|
|
13
|
+
var _mfaWithAuthenticator = _interopRequireDefault(require("./mfaWithAuthenticator.actions"));
|
|
14
|
+
var _mfaWithEmailCode = _interopRequireDefault(require("./mfaWithEmailCode.actions"));
|
|
15
|
+
var _mfaWithSMS = _interopRequireDefault(require("./mfaWithSMS.actions"));
|
|
16
|
+
var _mfaWithWebAuthn = _interopRequireDefault(require("./mfaWithWebAuthn.actions"));
|
|
17
|
+
var _interfaces = require("../interfaces");
|
|
18
|
+
var _helpers = require("../../../helpers");
|
|
19
|
+
var _state = require("../state");
|
|
20
|
+
var _helpers2 = require("../helpers");
|
|
21
|
+
var _restApi = require("@frontegg/rest-api");
|
|
22
|
+
var _hostedLoginAuthorize = _interopRequireDefault(require("./hostedLoginAuthorize.actions"));
|
|
23
|
+
var _toolkit = require("../../../toolkit");
|
|
24
|
+
var _interfaces2 = require("../../interfaces");
|
|
25
|
+
var _consts = require("../consts");
|
|
26
|
+
var _helpers3 = require("../../helpers");
|
|
27
|
+
var _interfaces3 = require("../../MfaState/interfaces");
|
|
28
|
+
var _interfaces4 = require("../../SSOState/interfaces");
|
|
29
|
+
const _excluded = ["callback"],
|
|
30
|
+
_excluded2 = ["callback"],
|
|
31
|
+
_excluded3 = ["callback"],
|
|
32
|
+
_excluded4 = ["callback"],
|
|
33
|
+
_excluded5 = ["callback"],
|
|
34
|
+
_excluded6 = ["callback", "events"],
|
|
35
|
+
_excluded7 = ["callback"],
|
|
36
|
+
_excluded8 = ["callback"],
|
|
37
|
+
_excluded9 = ["user"],
|
|
38
|
+
_excluded10 = ["callback"],
|
|
39
|
+
_excluded11 = ["callback"],
|
|
40
|
+
_excluded12 = ["callback"],
|
|
41
|
+
_excluded13 = ["callback"],
|
|
42
|
+
_excluded14 = ["callback"],
|
|
43
|
+
_excluded15 = ["callback"];
|
|
44
|
+
var _default = (store, api, sharedActions) => {
|
|
45
|
+
const actions = sharedActions;
|
|
46
|
+
const contextHolder = _restApi.ContextHolder.for(store.root.appName);
|
|
47
|
+
/** @private */
|
|
48
|
+
const __refreshTokenHosted = async () => {
|
|
49
|
+
const user = store.auth.user;
|
|
50
|
+
if (!(user != null && user.refreshToken)) {
|
|
51
|
+
contextHolder.setAccessToken(null);
|
|
52
|
+
contextHolder.setUser(null);
|
|
53
|
+
actions.setAuthState({
|
|
54
|
+
user: null,
|
|
55
|
+
isAuthenticated: false
|
|
56
|
+
});
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
const body = {
|
|
61
|
+
grant_type: 'refresh_token',
|
|
62
|
+
refresh_token: user == null ? void 0 : user.refreshToken
|
|
63
|
+
};
|
|
64
|
+
const response = await api.auth.exchangeOAuthTokensV2(body);
|
|
65
|
+
const updatedUser = await __handleUnnecessaryEntitlementsUpdate(response.user);
|
|
66
|
+
await actions.__afterAuthenticationStateUpdate((0, _extends2.default)({}, response, {
|
|
67
|
+
user: updatedUser
|
|
68
|
+
}), {
|
|
69
|
+
isAuthenticated: true
|
|
70
|
+
});
|
|
71
|
+
} catch (e) {
|
|
72
|
+
contextHolder.setAccessToken(null);
|
|
73
|
+
contextHolder.setUser(null);
|
|
74
|
+
actions.setAuthState({
|
|
75
|
+
user: null,
|
|
76
|
+
isAuthenticated: false
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const __shouldNevigateToRegisterQuickLogin = user => {
|
|
81
|
+
var _ref;
|
|
82
|
+
const {
|
|
83
|
+
routes,
|
|
84
|
+
loginState
|
|
85
|
+
} = store.auth;
|
|
86
|
+
const quickLoginToRegister = (_ref = localStorage.getItem('register-quick-login')) != null ? _ref : loginState.quickLoginToRegister;
|
|
87
|
+
return quickLoginToRegister && localStorage.getItem(`${user.id}-${quickLoginToRegister}`) !== 'true' && !window.location.pathname.endsWith(routes.logoutUrl);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/** @private */
|
|
91
|
+
const __refreshTokenEmbedded = async () => {
|
|
92
|
+
try {
|
|
93
|
+
const {
|
|
94
|
+
routes,
|
|
95
|
+
loginState,
|
|
96
|
+
onRedirectTo
|
|
97
|
+
} = store.auth;
|
|
98
|
+
const {
|
|
99
|
+
user,
|
|
100
|
+
tenants = [],
|
|
101
|
+
activeTenant
|
|
102
|
+
} = await api.auth.refreshTokenV3();
|
|
103
|
+
if ((0, _helpers3.isMfaRequired)(user, store.root.appName)) {
|
|
104
|
+
const mfaRequiredState = await actions.getMfaRequiredState(user);
|
|
105
|
+
actions.setAuthState(mfaRequiredState);
|
|
106
|
+
onRedirectTo(routes.loginUrl, {
|
|
107
|
+
preserveQueryParams: true
|
|
108
|
+
});
|
|
109
|
+
} else {
|
|
110
|
+
var _ref2;
|
|
111
|
+
if (user.id) {
|
|
112
|
+
localStorage.setItem('userId', user.id);
|
|
113
|
+
}
|
|
114
|
+
const quickLoginToRegister = (_ref2 = localStorage.getItem('register-quick-login')) != null ? _ref2 : loginState.quickLoginToRegister;
|
|
115
|
+
const shouldNavigateToRegisterQuickLogin = __shouldNevigateToRegisterQuickLogin(user);
|
|
116
|
+
const updatedUser = await __handleUnnecessaryEntitlementsUpdate(user);
|
|
117
|
+
actions.__afterAuthenticationStateUpdate({
|
|
118
|
+
user: updatedUser,
|
|
119
|
+
tenants,
|
|
120
|
+
activeTenant
|
|
121
|
+
}, {
|
|
122
|
+
loginState: (0, _extends2.default)({}, loginState, {
|
|
123
|
+
quickLoginToRegister,
|
|
124
|
+
flow: shouldNavigateToRegisterQuickLogin ? _interfaces.LoginFlow.RegisterQuickLogin : _interfaces.LoginFlow.Login
|
|
125
|
+
}),
|
|
126
|
+
isAuthenticated: true
|
|
127
|
+
});
|
|
128
|
+
await __handleRedirectRefreshToken(shouldNavigateToRegisterQuickLogin);
|
|
129
|
+
}
|
|
130
|
+
} catch (e) {
|
|
131
|
+
contextHolder.setAccessToken(null);
|
|
132
|
+
contextHolder.setUser(null);
|
|
133
|
+
actions.setAuthState({
|
|
134
|
+
user: undefined,
|
|
135
|
+
isAuthenticated: false
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/** @protected */
|
|
141
|
+
const __refreshToken = async () => {
|
|
142
|
+
const hostedLoginBox = store.auth.hostedLoginBox;
|
|
143
|
+
if (hostedLoginBox) {
|
|
144
|
+
await __refreshTokenHosted();
|
|
145
|
+
} else {
|
|
146
|
+
await __refreshTokenEmbedded();
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Prevent unnecessary entitlements reference update inside the user object by
|
|
152
|
+
* deep equality with the stored user.entitlements
|
|
153
|
+
* This function should not be used for first login because no stored entitlements.
|
|
154
|
+
* @param updatedUser new user response from the BE
|
|
155
|
+
* @returns final user object with the correct entitlements reference
|
|
156
|
+
*
|
|
157
|
+
* @private
|
|
158
|
+
*/
|
|
159
|
+
const __handleUnnecessaryEntitlementsUpdate = async updatedUser => {
|
|
160
|
+
var _store$auth$user;
|
|
161
|
+
// @ts-ignore TODO: fix entitlements state type
|
|
162
|
+
const oldEntitlements = (_store$auth$user = store.auth.user) == null ? void 0 : _store$auth$user.entitlements;
|
|
163
|
+
if ((0, _toolkit.isEntitlementsDeeplyEqual)(oldEntitlements, updatedUser == null ? void 0 : updatedUser.entitlements)) {
|
|
164
|
+
// set the previous entitlemenets object
|
|
165
|
+
return (0, _extends2.default)({}, updatedUser, {
|
|
166
|
+
entitlements: oldEntitlements
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
return updatedUser;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/** @private */
|
|
173
|
+
const __handleRedirectRefreshToken = async shouldNavigateToRegisterQuickLogin => {
|
|
174
|
+
var _window;
|
|
175
|
+
const url = new URL((_window = window) == null ? void 0 : _window.location.href);
|
|
176
|
+
const {
|
|
177
|
+
routes,
|
|
178
|
+
loginState,
|
|
179
|
+
onRedirectTo
|
|
180
|
+
} = store.auth;
|
|
181
|
+
const invitationToken = url.searchParams.get('invitationToken');
|
|
182
|
+
const redirectRoutes = [routes.socialLoginCallbackUrl, routes.oidcRedirectUrl, routes.samlCallbackUrl];
|
|
183
|
+
if (!invitationToken) {
|
|
184
|
+
redirectRoutes.push(routes.loginUrl, routes.signUpUrl);
|
|
185
|
+
}
|
|
186
|
+
if (shouldNavigateToRegisterQuickLogin) {
|
|
187
|
+
onRedirectTo(routes.loginUrl);
|
|
188
|
+
} else if (redirectRoutes.some(url => url && window.location.pathname.endsWith(url))) {
|
|
189
|
+
if (loginState.isNewUser && routes.signUpSuccessUrl && routes.socialLoginCallbackUrl === window.location.pathname) {
|
|
190
|
+
onRedirectTo(routes.signUpSuccessUrl, {
|
|
191
|
+
refresh: routes.signUpSuccessUrl.startsWith('http')
|
|
192
|
+
});
|
|
193
|
+
} else {
|
|
194
|
+
await actions.afterAuthNavigation();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/** @private */
|
|
200
|
+
const __loadSSOPublicConfigurationFunction = async () => {
|
|
201
|
+
try {
|
|
202
|
+
const {
|
|
203
|
+
isActive
|
|
204
|
+
} = await api.auth.getSSOPublicConfiguration();
|
|
205
|
+
actions.setAuthState({
|
|
206
|
+
isSSOAuth: isActive
|
|
207
|
+
});
|
|
208
|
+
} catch (e) {
|
|
209
|
+
actions.setAuthState({
|
|
210
|
+
isSSOAuth: false
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
const __refreshMetadata = async () => {
|
|
215
|
+
let ssoACS;
|
|
216
|
+
try {
|
|
217
|
+
var _metadata$configurati;
|
|
218
|
+
const metadata = await api.metadata.getSamlMetadata();
|
|
219
|
+
ssoACS = metadata == null ? void 0 : (_metadata$configurati = metadata.configuration) == null ? void 0 : _metadata$configurati.acsUrl;
|
|
220
|
+
} catch (e) {
|
|
221
|
+
console.error(e);
|
|
222
|
+
}
|
|
223
|
+
actions.setAuthState({
|
|
224
|
+
ssoACS
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
/** @private */
|
|
229
|
+
const __isMFARequiredSSR = async ({
|
|
230
|
+
accessToken,
|
|
231
|
+
user
|
|
232
|
+
}) => {
|
|
233
|
+
if (!accessToken) {
|
|
234
|
+
actions.setAuthState({
|
|
235
|
+
user: undefined,
|
|
236
|
+
isAuthenticated: false
|
|
237
|
+
});
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
const {
|
|
241
|
+
onRedirectTo,
|
|
242
|
+
routes
|
|
243
|
+
} = store.auth;
|
|
244
|
+
if ((0, _helpers3.isMfaRequired)(user, store.root.appName)) {
|
|
245
|
+
const mfaRequiredState = await actions.getMfaRequiredState(user);
|
|
246
|
+
actions.setAuthState(mfaRequiredState);
|
|
247
|
+
onRedirectTo(routes.loginUrl, {
|
|
248
|
+
preserveQueryParams: true
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
const setLoginState = state => {
|
|
253
|
+
Object.assign(store.auth.loginState, state);
|
|
254
|
+
};
|
|
255
|
+
const resetLoginState = () => {
|
|
256
|
+
store.auth.loginState = (0, _helpers.deepClone)(_state.initialState);
|
|
257
|
+
};
|
|
258
|
+
const requestAuthorize = async firstTime => {
|
|
259
|
+
const calls = [];
|
|
260
|
+
const callsAfterRefresh = [];
|
|
261
|
+
calls.push(__refreshToken());
|
|
262
|
+
if (firstTime) {
|
|
263
|
+
actions.setAuthState({
|
|
264
|
+
isLoading: true
|
|
265
|
+
});
|
|
266
|
+
calls.push(actions.loadSocialLoginsConfigurationV2());
|
|
267
|
+
calls.push(actions.loadAllowSignUps());
|
|
268
|
+
calls.push(actions.loadPublicAuthStrategiesPolicy());
|
|
269
|
+
calls.push(__loadSSOPublicConfigurationFunction());
|
|
270
|
+
calls.push(actions.loadVendorPublicInfo());
|
|
271
|
+
calls.push(__refreshMetadata());
|
|
272
|
+
/*
|
|
273
|
+
We will load custom login routes only if custom login is enabled
|
|
274
|
+
In order to check if custom login is enabled without the tenant alias (search-param/sub-domain)
|
|
275
|
+
we have to wait for the user state (refreshToken request)
|
|
276
|
+
*/
|
|
277
|
+
callsAfterRefresh.push(actions.loadCustomLoginRoutes());
|
|
278
|
+
}
|
|
279
|
+
await Promise.all(calls);
|
|
280
|
+
if (callsAfterRefresh.length > 0) {
|
|
281
|
+
await Promise.all(callsAfterRefresh);
|
|
282
|
+
}
|
|
283
|
+
actions.setAuthState({
|
|
284
|
+
isLoading: false
|
|
285
|
+
});
|
|
286
|
+
};
|
|
287
|
+
const requestAuthorizeSSR = async payload => {
|
|
288
|
+
const calls = [];
|
|
289
|
+
calls.push(actions.loadSocialLoginsConfigurationV2());
|
|
290
|
+
calls.push(actions.loadAllowSignUps());
|
|
291
|
+
calls.push(__loadSSOPublicConfigurationFunction());
|
|
292
|
+
calls.push(actions.loadVendorPublicInfo());
|
|
293
|
+
calls.push(__refreshMetadata());
|
|
294
|
+
calls.push(__isMFARequiredSSR(payload));
|
|
295
|
+
calls.push(actions.loadCustomLoginRoutes());
|
|
296
|
+
await Promise.all(calls);
|
|
297
|
+
};
|
|
298
|
+
const ssoPreloginFailed = async _ref3 => {
|
|
299
|
+
let {
|
|
300
|
+
callback
|
|
301
|
+
} = _ref3,
|
|
302
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(_ref3, _excluded);
|
|
303
|
+
const publicPolicy = store.auth.securityPolicyState.publicPolicy.policy;
|
|
304
|
+
if (!(publicPolicy != null && publicPolicy.authStrategy)) {
|
|
305
|
+
actions.setLoginState({
|
|
306
|
+
step: _interfaces.LoginStep.loginWithPassword,
|
|
307
|
+
loading: false
|
|
308
|
+
});
|
|
309
|
+
callback == null ? void 0 : callback();
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
if ((publicPolicy == null ? void 0 : publicPolicy.authStrategy) === _restApi.AuthStrategyEnum.EmailAndPassword) {
|
|
313
|
+
actions.setLoginState({
|
|
314
|
+
step: _interfaces.LoginStep.loginWithPassword,
|
|
315
|
+
loading: false
|
|
316
|
+
});
|
|
317
|
+
callback == null ? void 0 : callback();
|
|
318
|
+
} else if ([_restApi.AuthStrategyEnum.MagicLink, _restApi.AuthStrategyEnum.Code, _restApi.AuthStrategyEnum.SmsCode].includes(publicPolicy == null ? void 0 : publicPolicy.authStrategy)) {
|
|
319
|
+
await actions.passwordlessPreLogin((0, _extends2.default)({}, body, {
|
|
320
|
+
type: publicPolicy == null ? void 0 : publicPolicy.authStrategy,
|
|
321
|
+
callback
|
|
322
|
+
}));
|
|
323
|
+
} else {
|
|
324
|
+
actions.setLoginState({
|
|
325
|
+
step: _interfaces.LoginStep.loginWithPassword,
|
|
326
|
+
loading: false
|
|
327
|
+
});
|
|
328
|
+
callback == null ? void 0 : callback();
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
const preLogin = async payload => {
|
|
332
|
+
const {
|
|
333
|
+
email,
|
|
334
|
+
recaptchaToken,
|
|
335
|
+
invitationToken,
|
|
336
|
+
callback
|
|
337
|
+
} = payload;
|
|
338
|
+
setLoginState({
|
|
339
|
+
loading: true
|
|
340
|
+
});
|
|
341
|
+
try {
|
|
342
|
+
const onRedirectTo = store.auth.onRedirectTo;
|
|
343
|
+
const tenantId = (0, _helpers2.getSearchParam)(_helpers2.TENANT_ID_PARAM_KEY);
|
|
344
|
+
const preLoginResult = await api.auth.preLoginV2({
|
|
345
|
+
email,
|
|
346
|
+
tenantId
|
|
347
|
+
});
|
|
348
|
+
const {
|
|
349
|
+
address,
|
|
350
|
+
idpType
|
|
351
|
+
} = preLoginResult != null ? preLoginResult : {};
|
|
352
|
+
if (address) {
|
|
353
|
+
let ssoRedirectUrl = address;
|
|
354
|
+
if (idpType === _interfaces4.SamlVendors.Oidc && !ssoRedirectUrl.includes('redirect_uri')) {
|
|
355
|
+
const {
|
|
356
|
+
oidcRedirectUrl
|
|
357
|
+
} = store.auth.routes;
|
|
358
|
+
ssoRedirectUrl += `&redirect_uri=${window.location.origin}${oidcRedirectUrl}`;
|
|
359
|
+
}
|
|
360
|
+
if (_toolkit.FronteggNativeModule.isLoginWithSSOAvailable()) {
|
|
361
|
+
_toolkit.FronteggNativeModule.loginWithSSO(email);
|
|
362
|
+
setLoginState({
|
|
363
|
+
loading: false
|
|
364
|
+
});
|
|
365
|
+
callback == null ? void 0 : callback();
|
|
366
|
+
} else {
|
|
367
|
+
setLoginState({
|
|
368
|
+
step: _interfaces.LoginStep.redirectToSSO,
|
|
369
|
+
loading: false,
|
|
370
|
+
ssoRedirectUrl
|
|
371
|
+
});
|
|
372
|
+
setTimeout(() => {
|
|
373
|
+
onRedirectTo(ssoRedirectUrl, {
|
|
374
|
+
refresh: true
|
|
375
|
+
});
|
|
376
|
+
}, 2000);
|
|
377
|
+
}
|
|
378
|
+
} else {
|
|
379
|
+
await ssoPreloginFailed({
|
|
380
|
+
email,
|
|
381
|
+
recaptchaToken,
|
|
382
|
+
callback,
|
|
383
|
+
invitationToken
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
} catch (e) {
|
|
387
|
+
await ssoPreloginFailed({
|
|
388
|
+
email,
|
|
389
|
+
recaptchaToken,
|
|
390
|
+
callback,
|
|
391
|
+
invitationToken
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
const postLogin = async payload => {
|
|
396
|
+
const {
|
|
397
|
+
onRedirectTo,
|
|
398
|
+
routes
|
|
399
|
+
} = store.auth;
|
|
400
|
+
setLoginState({
|
|
401
|
+
loading: true
|
|
402
|
+
});
|
|
403
|
+
try {
|
|
404
|
+
const user = await api.auth.postLogin(payload);
|
|
405
|
+
actions.setAuthState({
|
|
406
|
+
user: user.accessToken ? user : undefined,
|
|
407
|
+
isAuthenticated: !!user.accessToken
|
|
408
|
+
});
|
|
409
|
+
await actions.afterAuthNavigation();
|
|
410
|
+
} catch (e) {
|
|
411
|
+
setTimeout(() => {
|
|
412
|
+
onRedirectTo(routes.authenticatedUrl);
|
|
413
|
+
}, 1000);
|
|
414
|
+
setLoginState({
|
|
415
|
+
step: _interfaces.LoginStep.loginWithSSOFailed,
|
|
416
|
+
loading: false
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
const login = async payload => {
|
|
421
|
+
const {
|
|
422
|
+
email,
|
|
423
|
+
password,
|
|
424
|
+
recaptchaToken,
|
|
425
|
+
invitationToken,
|
|
426
|
+
callback
|
|
427
|
+
} = payload;
|
|
428
|
+
setLoginState({
|
|
429
|
+
loading: true
|
|
430
|
+
});
|
|
431
|
+
try {
|
|
432
|
+
const {
|
|
433
|
+
user,
|
|
434
|
+
tenants = [],
|
|
435
|
+
activeTenant
|
|
436
|
+
} = await api.auth.loginv2({
|
|
437
|
+
email,
|
|
438
|
+
password,
|
|
439
|
+
recaptchaToken,
|
|
440
|
+
invitationToken
|
|
441
|
+
});
|
|
442
|
+
const {
|
|
443
|
+
onRedirectTo,
|
|
444
|
+
routes
|
|
445
|
+
} = store.auth;
|
|
446
|
+
if ((0, _helpers3.isMfaRequired)(user, store.root.appName)) {
|
|
447
|
+
const mfaRequiredState = await actions.getMfaRequiredState(user);
|
|
448
|
+
actions.setAuthState(mfaRequiredState);
|
|
449
|
+
onRedirectTo(routes.loginUrl, {
|
|
450
|
+
preserveQueryParams: true
|
|
451
|
+
});
|
|
452
|
+
} else {
|
|
453
|
+
const loginState = store.auth.loginState;
|
|
454
|
+
const isAuthenticated = !!user.accessToken;
|
|
455
|
+
if (user.id) {
|
|
456
|
+
localStorage.setItem('userId', user.id);
|
|
457
|
+
}
|
|
458
|
+
actions.__afterAuthenticationStateUpdate({
|
|
459
|
+
user,
|
|
460
|
+
tenants,
|
|
461
|
+
activeTenant
|
|
462
|
+
}, {
|
|
463
|
+
loginState: {
|
|
464
|
+
flow: loginState.flow,
|
|
465
|
+
quickLoginToRegister: loginState.quickLoginToRegister,
|
|
466
|
+
email,
|
|
467
|
+
loading: false,
|
|
468
|
+
error: undefined,
|
|
469
|
+
mfaToken: user.mfaToken,
|
|
470
|
+
step: loginState.flow === _interfaces.LoginFlow.Login ? _interfaces.LoginStep.success : loginState.step,
|
|
471
|
+
tenants,
|
|
472
|
+
tenantsLoading: true,
|
|
473
|
+
isBreachedPassword: user.isBreachedPassword
|
|
474
|
+
},
|
|
475
|
+
isAuthenticated
|
|
476
|
+
});
|
|
477
|
+
const [securityCenterLoginFlows] = await actions.getFeatureFlags(['security-center-show-login-flows']);
|
|
478
|
+
if (loginState.flow === _interfaces.LoginFlow.Login) {
|
|
479
|
+
if (securityCenterLoginFlows && user.isBreachedPassword && !isAuthenticated) {
|
|
480
|
+
setLoginState({
|
|
481
|
+
step: _interfaces.LoginStep.breachedPassword,
|
|
482
|
+
loading: false
|
|
483
|
+
});
|
|
484
|
+
} else {
|
|
485
|
+
if (isAuthenticated) {
|
|
486
|
+
const shouldShowPrompt = await actions.__shouldShowPromptPasskeys();
|
|
487
|
+
if (shouldShowPrompt) {
|
|
488
|
+
setLoginState({
|
|
489
|
+
step: _interfaces.LoginStep.promptPasskeys,
|
|
490
|
+
loading: false
|
|
491
|
+
});
|
|
492
|
+
onRedirectTo(routes.loginUrl, {
|
|
493
|
+
preserveQueryParams: true
|
|
494
|
+
});
|
|
495
|
+
} else {
|
|
496
|
+
await actions.afterAuthNavigation();
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// TODO: extract item name to constants
|
|
504
|
+
localStorage.removeItem('register-quick-login');
|
|
505
|
+
callback == null ? void 0 : callback(true);
|
|
506
|
+
} catch (e) {
|
|
507
|
+
contextHolder.setAccessToken(null);
|
|
508
|
+
contextHolder.setUser(null);
|
|
509
|
+
callback == null ? void 0 : callback(false, e);
|
|
510
|
+
setLoginState({
|
|
511
|
+
email,
|
|
512
|
+
error: (0, _helpers.errorHandler)(e),
|
|
513
|
+
loading: false
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
const logout = async payload => {
|
|
518
|
+
const hostedLoginBox = store.auth.hostedLoginBox;
|
|
519
|
+
actions.setAuthState({
|
|
520
|
+
isLoading: true
|
|
521
|
+
});
|
|
522
|
+
try {
|
|
523
|
+
if (hostedLoginBox) {
|
|
524
|
+
await api.auth.OAuthLogout();
|
|
525
|
+
} else {
|
|
526
|
+
await api.auth.logout();
|
|
527
|
+
}
|
|
528
|
+
} catch {
|
|
529
|
+
/* empty */
|
|
530
|
+
}
|
|
531
|
+
if (contextHolder.isSessionPerTenantEnabled()) {
|
|
532
|
+
(0, _restApi.removeTabTenantFromSessionStorage)();
|
|
533
|
+
}
|
|
534
|
+
actions.resetAuthState();
|
|
535
|
+
await actions.requestAuthorize(true);
|
|
536
|
+
payload == null ? void 0 : payload();
|
|
537
|
+
};
|
|
538
|
+
const silentLogout = async payload => {
|
|
539
|
+
var _payload$callbackTime;
|
|
540
|
+
try {
|
|
541
|
+
await api.auth.logout();
|
|
542
|
+
} catch {
|
|
543
|
+
/* empty */
|
|
544
|
+
}
|
|
545
|
+
if (contextHolder.isSessionPerTenantEnabled()) {
|
|
546
|
+
(0, _restApi.removeTabTenantFromSessionStorage)();
|
|
547
|
+
}
|
|
548
|
+
setTimeout(() => {
|
|
549
|
+
var _payload$callback;
|
|
550
|
+
return payload == null ? void 0 : (_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, true);
|
|
551
|
+
}, (_payload$callbackTime = payload == null ? void 0 : payload.callbackTimeout) != null ? _payload$callbackTime : 500);
|
|
552
|
+
};
|
|
553
|
+
const recoverMfa = async payload => {
|
|
554
|
+
setLoginState({
|
|
555
|
+
loading: true
|
|
556
|
+
});
|
|
557
|
+
try {
|
|
558
|
+
var _payload$callback2;
|
|
559
|
+
await api.auth.recoverMfaToken(payload);
|
|
560
|
+
setLoginState({
|
|
561
|
+
loading: false,
|
|
562
|
+
error: undefined,
|
|
563
|
+
step: _interfaces.LoginStep.preLogin
|
|
564
|
+
});
|
|
565
|
+
actions.setAuthState({
|
|
566
|
+
user: undefined,
|
|
567
|
+
isAuthenticated: false
|
|
568
|
+
});
|
|
569
|
+
(_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, true);
|
|
570
|
+
} catch (e) {
|
|
571
|
+
var _payload$callback3;
|
|
572
|
+
setLoginState({
|
|
573
|
+
error: (0, _helpers.errorHandler)(e),
|
|
574
|
+
loading: false
|
|
575
|
+
});
|
|
576
|
+
(_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, false, e);
|
|
577
|
+
}
|
|
578
|
+
};
|
|
579
|
+
const quickSmsPasswordlessPreLogin = async _payload => {
|
|
580
|
+
const {
|
|
581
|
+
callback
|
|
582
|
+
} = _payload,
|
|
583
|
+
payload = (0, _objectWithoutPropertiesLoose2.default)(_payload, _excluded2);
|
|
584
|
+
try {
|
|
585
|
+
setLoginState({
|
|
586
|
+
loading: true
|
|
587
|
+
});
|
|
588
|
+
|
|
589
|
+
// TODO: fix @frontegg/rest-api return value
|
|
590
|
+
// @ts-ignore
|
|
591
|
+
const preloginRes = await api.auth.passwordlessPreLogin((0, _extends2.default)({}, payload, {
|
|
592
|
+
type: _restApi.AuthStrategyEnum.SmsCode
|
|
593
|
+
}));
|
|
594
|
+
setLoginState({
|
|
595
|
+
step: _interfaces.LoginStep.loginWithQuickSmsOtc,
|
|
596
|
+
loading: false,
|
|
597
|
+
phoneNumber: preloginRes == null ? void 0 : preloginRes.phoneNumber,
|
|
598
|
+
error: undefined
|
|
599
|
+
});
|
|
600
|
+
callback == null ? void 0 : callback(true);
|
|
601
|
+
} catch (e) {
|
|
602
|
+
setLoginState({
|
|
603
|
+
error: (0, _helpers.errorHandler)(e),
|
|
604
|
+
loading: false
|
|
605
|
+
});
|
|
606
|
+
callback == null ? void 0 : callback(e);
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
const changePhoneNumberWithVerification = async _payload => {
|
|
610
|
+
const {
|
|
611
|
+
callback
|
|
612
|
+
} = _payload,
|
|
613
|
+
payload = (0, _objectWithoutPropertiesLoose2.default)(_payload, _excluded3);
|
|
614
|
+
try {
|
|
615
|
+
setLoginState({
|
|
616
|
+
loading: true
|
|
617
|
+
});
|
|
618
|
+
const changePhoneRes = await api.auth.changePhoneNumberWithVerification(payload);
|
|
619
|
+
setLoginState({
|
|
620
|
+
phoneNumber: payload.phoneNumber,
|
|
621
|
+
loading: false,
|
|
622
|
+
changePhoneId: changePhoneRes.changePhoneId,
|
|
623
|
+
step: _interfaces.LoginStep.loginWithQuickSmsOtc,
|
|
624
|
+
error: undefined
|
|
625
|
+
});
|
|
626
|
+
callback == null ? void 0 : callback(true);
|
|
627
|
+
} catch (e) {
|
|
628
|
+
setLoginState({
|
|
629
|
+
error: (0, _helpers.errorHandler)(e),
|
|
630
|
+
loading: false
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
const verifyChangePhoneNumber = async _payload => {
|
|
635
|
+
const {
|
|
636
|
+
callback
|
|
637
|
+
} = _payload,
|
|
638
|
+
payload = (0, _objectWithoutPropertiesLoose2.default)(_payload, _excluded4);
|
|
639
|
+
try {
|
|
640
|
+
setLoginState({
|
|
641
|
+
loading: true
|
|
642
|
+
});
|
|
643
|
+
await api.auth.verifyChangePhoneNumber(payload);
|
|
644
|
+
setLoginState({
|
|
645
|
+
loading: false
|
|
646
|
+
});
|
|
647
|
+
callback == null ? void 0 : callback(true);
|
|
648
|
+
} catch (e) {
|
|
649
|
+
setLoginState({
|
|
650
|
+
error: (0, _helpers.errorHandler)(e),
|
|
651
|
+
loading: false
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
const passwordlessPreLogin = async _payload => {
|
|
656
|
+
const {
|
|
657
|
+
callback
|
|
658
|
+
} = _payload,
|
|
659
|
+
payload = (0, _objectWithoutPropertiesLoose2.default)(_payload, _excluded5);
|
|
660
|
+
try {
|
|
661
|
+
setLoginState({
|
|
662
|
+
loading: true
|
|
663
|
+
});
|
|
664
|
+
let email;
|
|
665
|
+
if ((0, _helpers2.isEmailPayload)(payload)) {
|
|
666
|
+
email = payload.email;
|
|
667
|
+
}
|
|
668
|
+
// TODO: [Typescript 4.8] fix @frontegg/rest-api return value
|
|
669
|
+
// @ts-ignore
|
|
670
|
+
const preloginRes = await api.auth.passwordlessPreLogin(payload);
|
|
671
|
+
// @ts-ignore
|
|
672
|
+
const step = _consts.authStrategyLoginStepMap[payload.type];
|
|
673
|
+
setLoginState({
|
|
674
|
+
step,
|
|
675
|
+
loading: false,
|
|
676
|
+
phoneNumber: preloginRes == null ? void 0 : preloginRes.phoneNumber,
|
|
677
|
+
email,
|
|
678
|
+
error: undefined
|
|
679
|
+
});
|
|
680
|
+
callback == null ? void 0 : callback();
|
|
681
|
+
} catch (e) {
|
|
682
|
+
setLoginState({
|
|
683
|
+
error: (0, _helpers.errorHandler)(e),
|
|
684
|
+
loading: false
|
|
685
|
+
});
|
|
686
|
+
callback == null ? void 0 : callback(e);
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
const passwordlessPostLogin = async _payload => {
|
|
690
|
+
const {
|
|
691
|
+
callback,
|
|
692
|
+
events
|
|
693
|
+
} = _payload,
|
|
694
|
+
payload = (0, _objectWithoutPropertiesLoose2.default)(_payload, _excluded6);
|
|
695
|
+
try {
|
|
696
|
+
setLoginState({
|
|
697
|
+
loading: true
|
|
698
|
+
});
|
|
699
|
+
const {
|
|
700
|
+
user,
|
|
701
|
+
tenants = [],
|
|
702
|
+
activeTenant
|
|
703
|
+
} = await api.auth.passwordlessPostLoginV2(payload);
|
|
704
|
+
const {
|
|
705
|
+
routes,
|
|
706
|
+
onRedirectTo
|
|
707
|
+
} = store.auth;
|
|
708
|
+
if ((0, _helpers3.isMfaRequired)(user, store.root.appName)) {
|
|
709
|
+
const mfaRequiredState = await actions.getMfaRequiredState(user);
|
|
710
|
+
actions.setAuthState(mfaRequiredState);
|
|
711
|
+
onRedirectTo(routes.loginUrl, {
|
|
712
|
+
preserveQueryParams: true
|
|
713
|
+
});
|
|
714
|
+
} else {
|
|
715
|
+
const loginState = store.auth.loginState;
|
|
716
|
+
if (user.emailVerified) {
|
|
717
|
+
var _events$userVerified;
|
|
718
|
+
const userVerifiedPayload = {
|
|
719
|
+
email: user.email,
|
|
720
|
+
origin: _interfaces2.UserVeirifedOriginTypes.PASSWORDLESS,
|
|
721
|
+
id: user.id,
|
|
722
|
+
tenantId: user.tenantId,
|
|
723
|
+
createdAt: new Date(),
|
|
724
|
+
name: user.name
|
|
725
|
+
};
|
|
726
|
+
events == null ? void 0 : (_events$userVerified = events.userVerified) == null ? void 0 : _events$userVerified.call(events, userVerifiedPayload);
|
|
727
|
+
(0, _helpers.reportGTMEvent)(_helpers.GTMEventAction.USER_VERIFIED, userVerifiedPayload);
|
|
728
|
+
}
|
|
729
|
+
if (user.id) {
|
|
730
|
+
localStorage.setItem('userId', user.id);
|
|
731
|
+
}
|
|
732
|
+
actions.__afterAuthenticationStateUpdate({
|
|
733
|
+
user,
|
|
734
|
+
tenants,
|
|
735
|
+
activeTenant
|
|
736
|
+
});
|
|
737
|
+
setLoginState({
|
|
738
|
+
error: undefined
|
|
739
|
+
});
|
|
740
|
+
actions.setAuthState({
|
|
741
|
+
isLoading: false
|
|
742
|
+
});
|
|
743
|
+
if (loginState.flow === _interfaces.LoginFlow.Login) {
|
|
744
|
+
const shouldShowPrompt = await actions.__shouldShowPromptPasskeys();
|
|
745
|
+
if (shouldShowPrompt) {
|
|
746
|
+
actions.setLoginState({
|
|
747
|
+
step: _interfaces.LoginStep.promptPasskeys,
|
|
748
|
+
loading: false
|
|
749
|
+
});
|
|
750
|
+
onRedirectTo(routes.loginUrl, {
|
|
751
|
+
preserveQueryParams: true
|
|
752
|
+
});
|
|
753
|
+
} else {
|
|
754
|
+
actions.setAuthState({
|
|
755
|
+
isAuthenticated: true
|
|
756
|
+
});
|
|
757
|
+
await actions.afterAuthNavigation();
|
|
758
|
+
}
|
|
759
|
+
} else {
|
|
760
|
+
onRedirectTo(routes.loginUrl, {
|
|
761
|
+
preserveQueryParams: true
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
localStorage.removeItem('register-quick-login');
|
|
765
|
+
callback == null ? void 0 : callback(true);
|
|
766
|
+
}
|
|
767
|
+
} catch (e) {
|
|
768
|
+
setLoginState({
|
|
769
|
+
error: (0, _helpers.errorHandler)(e, 'Failed to authenticate')
|
|
770
|
+
});
|
|
771
|
+
callback == null ? void 0 : callback(null, e);
|
|
772
|
+
} finally {
|
|
773
|
+
setLoginState({
|
|
774
|
+
loading: false
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
};
|
|
778
|
+
const verifyInviteToken = async payload => {
|
|
779
|
+
try {
|
|
780
|
+
setLoginState({
|
|
781
|
+
loading: true
|
|
782
|
+
});
|
|
783
|
+
|
|
784
|
+
// @ts-ignore TODO: fix @frontegg/rest-api return value
|
|
785
|
+
const {
|
|
786
|
+
name: inviteTokenTenantName
|
|
787
|
+
} = await api.auth.verifyInviteToken(payload);
|
|
788
|
+
setLoginState({
|
|
789
|
+
inviteTokenTenantName
|
|
790
|
+
});
|
|
791
|
+
} catch (e) {
|
|
792
|
+
setLoginState({
|
|
793
|
+
inviteTokenError: (0, _helpers.errorHandler)(e, `We couldn't verify your invitation`)
|
|
794
|
+
});
|
|
795
|
+
} finally {
|
|
796
|
+
setLoginState({
|
|
797
|
+
loading: false
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
const webAuthnPrelogin = async payload => {
|
|
802
|
+
const {
|
|
803
|
+
callback
|
|
804
|
+
} = payload,
|
|
805
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded7);
|
|
806
|
+
try {
|
|
807
|
+
var _options$allowCredent;
|
|
808
|
+
actions.setPasskeysState({
|
|
809
|
+
loading: true
|
|
810
|
+
});
|
|
811
|
+
setLoginState({
|
|
812
|
+
loading: true
|
|
813
|
+
});
|
|
814
|
+
|
|
815
|
+
// @ts-ignore TODO: fix @frontegg/rest-api return value
|
|
816
|
+
const {
|
|
817
|
+
options
|
|
818
|
+
} = await api.auth.webAuthnPreLogin(body);
|
|
819
|
+
options.challenge = (0, _helpers.base64urlDecode)(options.challenge);
|
|
820
|
+
options.allowCredentials = (_options$allowCredent = options.allowCredentials) == null ? void 0 : _options$allowCredent.map(credentials => (0, _extends2.default)({}, credentials, {
|
|
821
|
+
id: (0, _helpers.base64urlDecode)(credentials.id)
|
|
822
|
+
}));
|
|
823
|
+
setLoginState({
|
|
824
|
+
error: undefined
|
|
825
|
+
});
|
|
826
|
+
callback == null ? void 0 : callback(options);
|
|
827
|
+
} catch (e) {
|
|
828
|
+
setLoginState({
|
|
829
|
+
error: (0, _helpers.errorHandler)(e)
|
|
830
|
+
});
|
|
831
|
+
callback == null ? void 0 : callback(null);
|
|
832
|
+
} finally {
|
|
833
|
+
actions.setPasskeysState({
|
|
834
|
+
loading: false
|
|
835
|
+
});
|
|
836
|
+
setLoginState({
|
|
837
|
+
loading: false
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
};
|
|
841
|
+
const webAuthnPostLogin = async payload => {
|
|
842
|
+
const {
|
|
843
|
+
callback
|
|
844
|
+
} = payload,
|
|
845
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded8);
|
|
846
|
+
try {
|
|
847
|
+
var _publicKey$response$u;
|
|
848
|
+
actions.setPasskeysState({
|
|
849
|
+
loading: true
|
|
850
|
+
});
|
|
851
|
+
setLoginState({
|
|
852
|
+
loading: true
|
|
853
|
+
});
|
|
854
|
+
const publicKey = (0, _helpers.publicKeyCredentialToJSON)(body.publicKey);
|
|
855
|
+
const _await$api$auth$webAu = await api.auth.webAuthnPostLoginV2((0, _extends2.default)({}, publicKey, {
|
|
856
|
+
response: (0, _extends2.default)({}, publicKey.response, {
|
|
857
|
+
userHandle: (_publicKey$response$u = publicKey.response.userHandle) != null ? _publicKey$response$u : undefined
|
|
858
|
+
}),
|
|
859
|
+
recaptchaToken: body.recaptchaToken,
|
|
860
|
+
invitationToken: body.invitationToken
|
|
861
|
+
})),
|
|
862
|
+
{
|
|
863
|
+
user
|
|
864
|
+
} = _await$api$auth$webAu,
|
|
865
|
+
rest = (0, _objectWithoutPropertiesLoose2.default)(_await$api$auth$webAu, _excluded9);
|
|
866
|
+
if ((0, _helpers3.isMfaRequired)(user, store.root.appName)) {
|
|
867
|
+
const {
|
|
868
|
+
routes,
|
|
869
|
+
onRedirectTo
|
|
870
|
+
} = store.auth;
|
|
871
|
+
const mfaRequiredState = await actions.getMfaRequiredState(user);
|
|
872
|
+
actions.setAuthState(mfaRequiredState);
|
|
873
|
+
onRedirectTo(routes.loginUrl, {
|
|
874
|
+
preserveQueryParams: true
|
|
875
|
+
});
|
|
876
|
+
} else {
|
|
877
|
+
if (user.id) {
|
|
878
|
+
localStorage.setItem('userId', user.id);
|
|
879
|
+
}
|
|
880
|
+
actions.__afterAuthenticationStateUpdate((0, _extends2.default)({
|
|
881
|
+
user
|
|
882
|
+
}, rest), {
|
|
883
|
+
isAuthenticated: true
|
|
884
|
+
});
|
|
885
|
+
setLoginState({
|
|
886
|
+
error: undefined
|
|
887
|
+
});
|
|
888
|
+
await actions.afterAuthNavigation();
|
|
889
|
+
// TODO: Itamar why moving callback to inside the else block
|
|
890
|
+
callback == null ? void 0 : callback(true);
|
|
891
|
+
}
|
|
892
|
+
// callback?.(true);
|
|
893
|
+
} catch (e) {
|
|
894
|
+
setLoginState({
|
|
895
|
+
error: (0, _helpers.errorHandler)(e)
|
|
896
|
+
});
|
|
897
|
+
callback == null ? void 0 : callback(null);
|
|
898
|
+
} finally {
|
|
899
|
+
actions.setPasskeysState({
|
|
900
|
+
loading: false
|
|
901
|
+
});
|
|
902
|
+
setLoginState({
|
|
903
|
+
loading: false
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
};
|
|
907
|
+
const webAuthnCreateNewDeviceSession = async payload => {
|
|
908
|
+
const {
|
|
909
|
+
callback
|
|
910
|
+
} = payload;
|
|
911
|
+
try {
|
|
912
|
+
setLoginState({
|
|
913
|
+
loading: true
|
|
914
|
+
});
|
|
915
|
+
|
|
916
|
+
// @ts-ignore TODO: fix @frontegg/rest-api return value
|
|
917
|
+
const {
|
|
918
|
+
options
|
|
919
|
+
} = await api.auth.webAuthnCreateNewDeviceSession();
|
|
920
|
+
options.user.id = (0, _helpers.base64urlDecode)(options.user.id);
|
|
921
|
+
options.challenge = (0, _helpers.base64urlDecode)(options.challenge);
|
|
922
|
+
options.excludeCredentials = [];
|
|
923
|
+
callback == null ? void 0 : callback(options);
|
|
924
|
+
} catch (e) {
|
|
925
|
+
setLoginState({
|
|
926
|
+
error: (0, _helpers.errorHandler)(e)
|
|
927
|
+
});
|
|
928
|
+
callback == null ? void 0 : callback(null);
|
|
929
|
+
} finally {
|
|
930
|
+
setLoginState({
|
|
931
|
+
loading: false
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
const webAuthnVerifyNewDeviceSession = async payload => {
|
|
936
|
+
const {
|
|
937
|
+
callback
|
|
938
|
+
} = payload,
|
|
939
|
+
body = (0, _objectWithoutPropertiesLoose2.default)(payload, _excluded10);
|
|
940
|
+
try {
|
|
941
|
+
setLoginState({
|
|
942
|
+
loading: true
|
|
943
|
+
});
|
|
944
|
+
const publicKey = (0, _helpers.publicKeyCredentialToJSON)(body.publicKey);
|
|
945
|
+
const deviceType = (publicKey == null ? void 0 : publicKey.authenticatorAttachment) === 'platform' ? _restApi.WebAuthnDeviceType.Platform : _restApi.WebAuthnDeviceType.CrossPlatform;
|
|
946
|
+
await api.auth.verifyNewDeviceSession({
|
|
947
|
+
id: publicKey.id,
|
|
948
|
+
response: publicKey.response,
|
|
949
|
+
deviceType: deviceType
|
|
950
|
+
});
|
|
951
|
+
callback == null ? void 0 : callback(true);
|
|
952
|
+
} catch (e) {
|
|
953
|
+
setLoginState({
|
|
954
|
+
error: (0, _helpers.errorHandler)(e)
|
|
955
|
+
});
|
|
956
|
+
callback == null ? void 0 : callback(null);
|
|
957
|
+
} finally {
|
|
958
|
+
setLoginState({
|
|
959
|
+
loading: false
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
};
|
|
963
|
+
const getUserIP = async payload => {
|
|
964
|
+
const {
|
|
965
|
+
callback
|
|
966
|
+
} = payload;
|
|
967
|
+
try {
|
|
968
|
+
const {
|
|
969
|
+
ip
|
|
970
|
+
} = await api.metadata.getCurrentUserIpMetadata();
|
|
971
|
+
actions.setAuthState({
|
|
972
|
+
userIp: ip
|
|
973
|
+
});
|
|
974
|
+
callback == null ? void 0 : callback(true);
|
|
975
|
+
} catch (e) {
|
|
976
|
+
callback == null ? void 0 : callback(false);
|
|
977
|
+
}
|
|
978
|
+
};
|
|
979
|
+
const preEnrollMFAWebAuthnForLogin = async _payload => {
|
|
980
|
+
const {
|
|
981
|
+
callback
|
|
982
|
+
} = _payload,
|
|
983
|
+
payload = (0, _objectWithoutPropertiesLoose2.default)(_payload, _excluded11);
|
|
984
|
+
setLoginState({
|
|
985
|
+
loading: true
|
|
986
|
+
});
|
|
987
|
+
try {
|
|
988
|
+
var _data$options$exclude;
|
|
989
|
+
const data = await api.auth.preEnrollMFAWebAuthnForLogin(payload);
|
|
990
|
+
const options = (0, _extends2.default)({}, data.options, {
|
|
991
|
+
challenge: (0, _helpers.base64urlDecode)(data.options.challenge),
|
|
992
|
+
user: (0, _extends2.default)({}, data.options.user, {
|
|
993
|
+
id: (0, _helpers.base64urlDecode)(data.options.user.id)
|
|
994
|
+
}),
|
|
995
|
+
excludeCredentials: (_data$options$exclude = data.options.excludeCredentials) == null ? void 0 : _data$options$exclude.map(credentials => (0, _extends2.default)({}, credentials, {
|
|
996
|
+
id: (0, _helpers.base64urlDecode)(credentials.id)
|
|
997
|
+
}))
|
|
998
|
+
});
|
|
999
|
+
setLoginState({
|
|
1000
|
+
loading: false
|
|
1001
|
+
});
|
|
1002
|
+
callback == null ? void 0 : callback({
|
|
1003
|
+
options,
|
|
1004
|
+
webauthnToken: data.webauthnToken
|
|
1005
|
+
});
|
|
1006
|
+
} catch (e) {
|
|
1007
|
+
setLoginState({
|
|
1008
|
+
loading: false,
|
|
1009
|
+
error: (0, _helpers.errorHandler)(e)
|
|
1010
|
+
});
|
|
1011
|
+
callback == null ? void 0 : callback(null);
|
|
1012
|
+
}
|
|
1013
|
+
};
|
|
1014
|
+
const enrollMFAWebAuthnForLogin = async _payload => {
|
|
1015
|
+
const {
|
|
1016
|
+
callback
|
|
1017
|
+
} = _payload,
|
|
1018
|
+
payload = (0, _objectWithoutPropertiesLoose2.default)(_payload, _excluded12);
|
|
1019
|
+
setLoginState({
|
|
1020
|
+
loading: true
|
|
1021
|
+
});
|
|
1022
|
+
try {
|
|
1023
|
+
const publicKey = (0, _helpers.publicKeyCredentialToJSON)(payload.publicKey);
|
|
1024
|
+
const data = await api.auth.enrollMFAWebAuthnForLoginV2((0, _extends2.default)({}, payload, {
|
|
1025
|
+
options: publicKey
|
|
1026
|
+
}));
|
|
1027
|
+
await handleEnrollMFAResponse(data);
|
|
1028
|
+
setLoginState({
|
|
1029
|
+
loading: false
|
|
1030
|
+
});
|
|
1031
|
+
callback == null ? void 0 : callback(true);
|
|
1032
|
+
} catch (e) {
|
|
1033
|
+
setLoginState({
|
|
1034
|
+
loading: false,
|
|
1035
|
+
error: (0, _helpers.errorHandler)(e)
|
|
1036
|
+
});
|
|
1037
|
+
callback == null ? void 0 : callback(null);
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
const enrollMFAAuthenticatorAppForLogin = async _payload => {
|
|
1041
|
+
const {
|
|
1042
|
+
callback
|
|
1043
|
+
} = _payload,
|
|
1044
|
+
payload = (0, _objectWithoutPropertiesLoose2.default)(_payload, _excluded13);
|
|
1045
|
+
setLoginState({
|
|
1046
|
+
loading: true
|
|
1047
|
+
});
|
|
1048
|
+
try {
|
|
1049
|
+
const data = await api.auth.enrollMFAAuthenticatorAppForLoginV2(payload);
|
|
1050
|
+
await handleEnrollMFAResponse(data);
|
|
1051
|
+
setLoginState({
|
|
1052
|
+
loading: false
|
|
1053
|
+
});
|
|
1054
|
+
callback == null ? void 0 : callback(true);
|
|
1055
|
+
} catch (e) {
|
|
1056
|
+
setLoginState({
|
|
1057
|
+
loading: false,
|
|
1058
|
+
error: (0, _helpers.errorHandler)(e)
|
|
1059
|
+
});
|
|
1060
|
+
callback == null ? void 0 : callback(null);
|
|
1061
|
+
}
|
|
1062
|
+
};
|
|
1063
|
+
const preEnrollMFASMSForLogin = async _payload => {
|
|
1064
|
+
const {
|
|
1065
|
+
callback
|
|
1066
|
+
} = _payload,
|
|
1067
|
+
payload = (0, _objectWithoutPropertiesLoose2.default)(_payload, _excluded14);
|
|
1068
|
+
setLoginState({
|
|
1069
|
+
loading: true
|
|
1070
|
+
});
|
|
1071
|
+
try {
|
|
1072
|
+
const data = await api.auth.preEnrollMFASMSForLogin(payload);
|
|
1073
|
+
actions.setMfaState({
|
|
1074
|
+
otcToken: data.otcToken,
|
|
1075
|
+
step: _interfaces3.MFAStep.smsVerifyCode,
|
|
1076
|
+
phoneNumber: data.phoneNumber
|
|
1077
|
+
});
|
|
1078
|
+
setLoginState({
|
|
1079
|
+
loading: false
|
|
1080
|
+
});
|
|
1081
|
+
callback == null ? void 0 : callback(true);
|
|
1082
|
+
} catch (e) {
|
|
1083
|
+
setLoginState({
|
|
1084
|
+
loading: false,
|
|
1085
|
+
error: (0, _helpers.errorHandler)(e)
|
|
1086
|
+
});
|
|
1087
|
+
callback == null ? void 0 : callback(null);
|
|
1088
|
+
}
|
|
1089
|
+
};
|
|
1090
|
+
const enrollMFASMSForLogin = async _payload => {
|
|
1091
|
+
const {
|
|
1092
|
+
callback
|
|
1093
|
+
} = _payload,
|
|
1094
|
+
payload = (0, _objectWithoutPropertiesLoose2.default)(_payload, _excluded15);
|
|
1095
|
+
setLoginState({
|
|
1096
|
+
loading: true
|
|
1097
|
+
});
|
|
1098
|
+
try {
|
|
1099
|
+
const data = await api.auth.enrollMFASMSForLoginV2(payload);
|
|
1100
|
+
await handleEnrollMFAResponse(data);
|
|
1101
|
+
setLoginState({
|
|
1102
|
+
loading: false
|
|
1103
|
+
});
|
|
1104
|
+
callback == null ? void 0 : callback(true);
|
|
1105
|
+
} catch (e) {
|
|
1106
|
+
setLoginState({
|
|
1107
|
+
loading: false,
|
|
1108
|
+
error: (0, _helpers.errorHandler)(e)
|
|
1109
|
+
});
|
|
1110
|
+
callback == null ? void 0 : callback(null);
|
|
1111
|
+
}
|
|
1112
|
+
};
|
|
1113
|
+
const handleEnrollMFAResponse = async payload => {
|
|
1114
|
+
const {
|
|
1115
|
+
user,
|
|
1116
|
+
tenants = [],
|
|
1117
|
+
activeTenant
|
|
1118
|
+
} = payload;
|
|
1119
|
+
const mfaState = {
|
|
1120
|
+
step: _interfaces3.MFAStep.recoveryCode,
|
|
1121
|
+
loading: false,
|
|
1122
|
+
error: undefined,
|
|
1123
|
+
saving: false
|
|
1124
|
+
};
|
|
1125
|
+
if (user != null && user.recoveryCode) {
|
|
1126
|
+
mfaState.recoveryCode = user.recoveryCode;
|
|
1127
|
+
}
|
|
1128
|
+
actions.setMfaState(mfaState);
|
|
1129
|
+
actions.setUser(user);
|
|
1130
|
+
actions.setTenantsState({
|
|
1131
|
+
tenants,
|
|
1132
|
+
activeTenant,
|
|
1133
|
+
loading: false
|
|
1134
|
+
});
|
|
1135
|
+
if (user.id) {
|
|
1136
|
+
localStorage.setItem('userId', user.id);
|
|
1137
|
+
}
|
|
1138
|
+
};
|
|
1139
|
+
const resetBreachedPassword = async payload => {
|
|
1140
|
+
setLoginState({
|
|
1141
|
+
loading: true
|
|
1142
|
+
});
|
|
1143
|
+
try {
|
|
1144
|
+
await api.auth.forgotPassword(payload);
|
|
1145
|
+
setLoginState({
|
|
1146
|
+
loading: false,
|
|
1147
|
+
error: undefined,
|
|
1148
|
+
step: _interfaces.LoginStep.breachedPasswordSuccess
|
|
1149
|
+
});
|
|
1150
|
+
actions.setAuthState({
|
|
1151
|
+
isAuthenticated: false
|
|
1152
|
+
});
|
|
1153
|
+
} catch (e) {
|
|
1154
|
+
setLoginState({
|
|
1155
|
+
loading: false,
|
|
1156
|
+
error: (0, _helpers.errorHandler)(e)
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1160
|
+
|
|
1161
|
+
/** @private */
|
|
1162
|
+
const __refreshTokenHostedSocialLogins = async () => {
|
|
1163
|
+
const {
|
|
1164
|
+
user: currentUser
|
|
1165
|
+
} = store.auth;
|
|
1166
|
+
if (!(currentUser != null && currentUser.refreshToken)) {
|
|
1167
|
+
contextHolder.setAccessToken(null);
|
|
1168
|
+
contextHolder.setUser(null);
|
|
1169
|
+
actions.setAuthState({
|
|
1170
|
+
user: null,
|
|
1171
|
+
isAuthenticated: false
|
|
1172
|
+
});
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
try {
|
|
1176
|
+
const body = {
|
|
1177
|
+
grant_type: 'refresh_token',
|
|
1178
|
+
refresh_token: currentUser == null ? void 0 : currentUser.refreshToken
|
|
1179
|
+
};
|
|
1180
|
+
const response = await api.auth.exchangeOAuthTokensV2(body);
|
|
1181
|
+
const updatedUser = await __handleUnnecessaryEntitlementsUpdate(response.user);
|
|
1182
|
+
actions.__afterAuthenticationStateUpdate((0, _extends2.default)({}, response, {
|
|
1183
|
+
user: updatedUser
|
|
1184
|
+
}), {
|
|
1185
|
+
isAuthenticated: true
|
|
1186
|
+
});
|
|
1187
|
+
} catch (e) {
|
|
1188
|
+
contextHolder.setAccessToken(null);
|
|
1189
|
+
contextHolder.setUser(null);
|
|
1190
|
+
actions.setAuthState({
|
|
1191
|
+
user: null,
|
|
1192
|
+
isAuthenticated: false
|
|
1193
|
+
});
|
|
1194
|
+
}
|
|
1195
|
+
};
|
|
1196
|
+
/** @private */
|
|
1197
|
+
const __refreshTokenEmbeddedSocialLogins = async () => {
|
|
1198
|
+
try {
|
|
1199
|
+
const {
|
|
1200
|
+
routes,
|
|
1201
|
+
loginState,
|
|
1202
|
+
onRedirectTo
|
|
1203
|
+
} = store.auth;
|
|
1204
|
+
const {
|
|
1205
|
+
user,
|
|
1206
|
+
tenants = [],
|
|
1207
|
+
activeTenant
|
|
1208
|
+
} = await api.auth.refreshTokenV3();
|
|
1209
|
+
if ((0, _helpers3.isMfaRequired)(user, store.root.appName)) {
|
|
1210
|
+
const mfaRequiredState = await actions.getMfaRequiredState(user);
|
|
1211
|
+
actions.setAuthState(mfaRequiredState);
|
|
1212
|
+
onRedirectTo(routes.loginUrl, {
|
|
1213
|
+
preserveQueryParams: true
|
|
1214
|
+
});
|
|
1215
|
+
} else {
|
|
1216
|
+
const updatedUser = await __handleUnnecessaryEntitlementsUpdate(user);
|
|
1217
|
+
const shouldShowPrompt = await actions.__shouldShowPromptPasskeys();
|
|
1218
|
+
if (shouldShowPrompt) {
|
|
1219
|
+
actions.setLoginState({
|
|
1220
|
+
step: _interfaces.LoginStep.promptPasskeys,
|
|
1221
|
+
loading: false
|
|
1222
|
+
});
|
|
1223
|
+
actions.__afterAuthenticationStateUpdate({
|
|
1224
|
+
user: updatedUser,
|
|
1225
|
+
tenants,
|
|
1226
|
+
activeTenant
|
|
1227
|
+
}, {
|
|
1228
|
+
isLoading: false
|
|
1229
|
+
});
|
|
1230
|
+
onRedirectTo(routes.loginUrl, {
|
|
1231
|
+
preserveQueryParams: true
|
|
1232
|
+
});
|
|
1233
|
+
} else {
|
|
1234
|
+
var _ref4;
|
|
1235
|
+
if (user.id) {
|
|
1236
|
+
localStorage.setItem('userId', user.id);
|
|
1237
|
+
}
|
|
1238
|
+
const quickLoginToRegister = (_ref4 = localStorage.getItem('register-quick-login')) != null ? _ref4 : loginState.quickLoginToRegister;
|
|
1239
|
+
const shouldNavigateToRegisterQuickLogin = __shouldNevigateToRegisterQuickLogin(user);
|
|
1240
|
+
actions.__afterAuthenticationStateUpdate({
|
|
1241
|
+
user: updatedUser,
|
|
1242
|
+
tenants,
|
|
1243
|
+
activeTenant
|
|
1244
|
+
}, {
|
|
1245
|
+
loginState: (0, _extends2.default)({}, loginState, {
|
|
1246
|
+
quickLoginToRegister,
|
|
1247
|
+
flow: shouldNavigateToRegisterQuickLogin ? _interfaces.LoginFlow.RegisterQuickLogin : _interfaces.LoginFlow.Login
|
|
1248
|
+
}),
|
|
1249
|
+
isAuthenticated: true
|
|
1250
|
+
});
|
|
1251
|
+
await __handleRedirectRefreshToken(shouldNavigateToRegisterQuickLogin);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
} catch (e) {
|
|
1255
|
+
contextHolder.setAccessToken(null);
|
|
1256
|
+
contextHolder.setUser(null);
|
|
1257
|
+
actions.setAuthState({
|
|
1258
|
+
user: undefined,
|
|
1259
|
+
isAuthenticated: false
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
};
|
|
1263
|
+
const refreshTokenForSocialLogins = async () => {
|
|
1264
|
+
if (store.auth.hostedLoginBox) {
|
|
1265
|
+
await __refreshTokenHostedSocialLogins();
|
|
1266
|
+
} else {
|
|
1267
|
+
await __refreshTokenEmbeddedSocialLogins();
|
|
1268
|
+
}
|
|
1269
|
+
};
|
|
1270
|
+
return (0, _extends2.default)({
|
|
1271
|
+
setLoginState,
|
|
1272
|
+
resetLoginState,
|
|
1273
|
+
requestAuthorize,
|
|
1274
|
+
requestAuthorizeSSR,
|
|
1275
|
+
preLogin,
|
|
1276
|
+
postLogin,
|
|
1277
|
+
login,
|
|
1278
|
+
logout,
|
|
1279
|
+
silentLogout,
|
|
1280
|
+
recoverMfa,
|
|
1281
|
+
quickSmsPasswordlessPreLogin,
|
|
1282
|
+
changePhoneNumberWithVerification,
|
|
1283
|
+
verifyChangePhoneNumber,
|
|
1284
|
+
passwordlessPreLogin,
|
|
1285
|
+
passwordlessPostLogin,
|
|
1286
|
+
verifyInviteToken,
|
|
1287
|
+
webAuthnPrelogin,
|
|
1288
|
+
webAuthnPostLogin,
|
|
1289
|
+
webAuthnCreateNewDeviceSession,
|
|
1290
|
+
webAuthnVerifyNewDeviceSession,
|
|
1291
|
+
getUserIP,
|
|
1292
|
+
preEnrollMFAWebAuthnForLogin,
|
|
1293
|
+
enrollMFAWebAuthnForLogin,
|
|
1294
|
+
enrollMFAAuthenticatorAppForLogin,
|
|
1295
|
+
preEnrollMFASMSForLogin,
|
|
1296
|
+
enrollMFASMSForLogin,
|
|
1297
|
+
handleEnrollMFAResponse,
|
|
1298
|
+
resetBreachedPassword,
|
|
1299
|
+
refreshTokenForSocialLogins,
|
|
1300
|
+
// protected
|
|
1301
|
+
__refreshToken
|
|
1302
|
+
}, (0, _hostedLoginAuthorize.default)(store, api, sharedActions), (0, _afterAuthNavigation.default)(store, api, sharedActions), (0, _handleVerifyMFAResponse.default)(store, api, sharedActions), (0, _mfaRequiredState.default)(store, api, sharedActions), (0, _mfaWithAuthenticator.default)(store, api, sharedActions), (0, _mfaWithEmailCode.default)(store, api, sharedActions), (0, _mfaWithSMS.default)(store, api, sharedActions), (0, _mfaWithWebAuthn.default)(store, api, sharedActions));
|
|
1303
|
+
};
|
|
1304
|
+
exports.default = _default;
|