@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
package/auth/LoginState/saga.js
DELETED
|
@@ -1,1967 +0,0 @@
|
|
|
1
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["callback"],
|
|
4
|
-
_excluded2 = ["callback"],
|
|
5
|
-
_excluded3 = ["callback"],
|
|
6
|
-
_excluded4 = ["callback"],
|
|
7
|
-
_excluded5 = ["callback", "events"],
|
|
8
|
-
_excluded6 = ["callback"],
|
|
9
|
-
_excluded7 = ["callback"],
|
|
10
|
-
_excluded8 = ["callback"],
|
|
11
|
-
_excluded9 = ["callback"],
|
|
12
|
-
_excluded10 = ["user"],
|
|
13
|
-
_excluded11 = ["callback"],
|
|
14
|
-
_excluded12 = ["callback"],
|
|
15
|
-
_excluded13 = ["callback"],
|
|
16
|
-
_excluded14 = ["callback"],
|
|
17
|
-
_excluded15 = ["callback"],
|
|
18
|
-
_excluded16 = ["callback", "deviceId"],
|
|
19
|
-
_excluded17 = ["callback"],
|
|
20
|
-
_excluded18 = ["callback"],
|
|
21
|
-
_excluded19 = ["callback", "deviceId"],
|
|
22
|
-
_excluded20 = ["callback", "deviceId"],
|
|
23
|
-
_excluded21 = ["callback", "deviceId"];
|
|
24
|
-
import { all, call, put, select, takeLeading } from 'redux-saga/effects';
|
|
25
|
-
import { api, AuthStrategyEnum, ContextHolder, fetch, WebAuthnDeviceType } from '@frontegg/rest-api';
|
|
26
|
-
import { actions } from '../reducer';
|
|
27
|
-
import { FRONTEGG_AFTER_AUTH_REDIRECT_URL, HOSTED_LOGIN_VERIFIER_KEY } from '../../constants';
|
|
28
|
-
import { UserVeirifedOriginTypes } from '../interfaces';
|
|
29
|
-
import { LoginFlow, LoginStep } from './interfaces';
|
|
30
|
-
import { getMfaRequiredState } from './mfaRequiredState.saga';
|
|
31
|
-
import { loadAllowSignUps } from '../SignUp/saga';
|
|
32
|
-
import { MFAStep } from '../MfaState/interfaces';
|
|
33
|
-
import { dummyIps, userDemo } from '../dummy';
|
|
34
|
-
import { SamlVendors } from '../SSOState/interfaces';
|
|
35
|
-
import { loadVendorPublicInfo } from '../../vendor/saga';
|
|
36
|
-
import { createRandomString, generateCodeChallenge, getFeatureFlags } from '../../helpers';
|
|
37
|
-
import { ResetPhoneNumberStep } from '../ResetPhoneNumberState/interfaces';
|
|
38
|
-
import { base64urlDecode, delay, publicKeyCredentialToJSON } from '../utils';
|
|
39
|
-
import { loadPublicAuthStrategiesPolicy } from '../Security/SecurityPolicyState/saga';
|
|
40
|
-
import { getPasskeysVendorPolicy } from '../PasskeysState/helpers';
|
|
41
|
-
import { getPathAndSearchParamsFromUrl, getRedirectUrl, getSearchParam, TENANT_ID_PARAM_KEY, isMfaRequired, isOauthCallbackRoute } from './utils';
|
|
42
|
-
import { errorHandler, GTMEventAction, reportGTMEvent } from '../../utils';
|
|
43
|
-
import { authStrategyLoginStepMap } from './consts';
|
|
44
|
-
import { isEntitlementsDeeplyEqual } from '../Entitlements';
|
|
45
|
-
import { customLoginEnabled, loadCustomLoginRoutes } from '../CustomLoginState/saga';
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Prevent unnecessary entitlements reference update inside the user object by
|
|
49
|
-
* deep equality with the stored user.entitlements
|
|
50
|
-
* This function should not be used for first login because no stored entitlements.
|
|
51
|
-
* @param updatedUser new user response from the BE
|
|
52
|
-
* @returns final user object with the correct entitlements reference
|
|
53
|
-
*/
|
|
54
|
-
function* handleUnnecessaryEntitlementsUpdate(updatedUser) {
|
|
55
|
-
const oldEntitlements = yield select(state => {
|
|
56
|
-
var _state$auth$user;
|
|
57
|
-
return (_state$auth$user = state.auth.user) == null ? void 0 : _state$auth$user.entitlements;
|
|
58
|
-
});
|
|
59
|
-
if (isEntitlementsDeeplyEqual(oldEntitlements, updatedUser == null ? void 0 : updatedUser.entitlements)) {
|
|
60
|
-
// set the previous entitlemenets object
|
|
61
|
-
return _extends({}, updatedUser, {
|
|
62
|
-
entitlements: oldEntitlements
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
return updatedUser;
|
|
66
|
-
}
|
|
67
|
-
export function* afterAuthenticationStateUpdate({
|
|
68
|
-
user,
|
|
69
|
-
tenants = [],
|
|
70
|
-
activeTenant
|
|
71
|
-
}, additionalUpdate = {}) {
|
|
72
|
-
const {
|
|
73
|
-
tenantsState: currentTenantsState
|
|
74
|
-
} = yield select(state => state.auth);
|
|
75
|
-
yield put(actions.setState(_extends({
|
|
76
|
-
user,
|
|
77
|
-
tenantsState: _extends({}, currentTenantsState, {
|
|
78
|
-
tenants,
|
|
79
|
-
activeTenant,
|
|
80
|
-
loading: false
|
|
81
|
-
})
|
|
82
|
-
}, additionalUpdate)));
|
|
83
|
-
}
|
|
84
|
-
export function* afterAuthNavigation() {
|
|
85
|
-
const onRedirectTo = ContextHolder.onRedirectTo;
|
|
86
|
-
const {
|
|
87
|
-
routes,
|
|
88
|
-
includeQueryParam,
|
|
89
|
-
enforceRedirectToSameSite = false,
|
|
90
|
-
allowedRedirectOrigins = []
|
|
91
|
-
} = yield select(state => state.auth);
|
|
92
|
-
const {
|
|
93
|
-
loginUrl,
|
|
94
|
-
logoutUrl,
|
|
95
|
-
socialLoginCallbackUrl,
|
|
96
|
-
activateUrl
|
|
97
|
-
} = routes;
|
|
98
|
-
let {
|
|
99
|
-
authenticatedUrl,
|
|
100
|
-
customLoginAuthenticatedUrl
|
|
101
|
-
} = routes;
|
|
102
|
-
if (!customLoginAuthenticatedUrl) {
|
|
103
|
-
yield call(loadCustomLoginRoutes);
|
|
104
|
-
customLoginAuthenticatedUrl = yield select(state => {
|
|
105
|
-
var _state$auth$routes;
|
|
106
|
-
return (_state$auth$routes = state.auth.routes) == null ? void 0 : _state$auth$routes.customLoginAuthenticatedUrl;
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
const afterAuthRedirect = window.localStorage.getItem(FRONTEGG_AFTER_AUTH_REDIRECT_URL);
|
|
110
|
-
if (afterAuthRedirect && ![loginUrl, logoutUrl, socialLoginCallbackUrl, activateUrl].includes(afterAuthRedirect)) {
|
|
111
|
-
authenticatedUrl = afterAuthRedirect;
|
|
112
|
-
}
|
|
113
|
-
window.localStorage.removeItem(FRONTEGG_AFTER_AUTH_REDIRECT_URL);
|
|
114
|
-
yield delay(200);
|
|
115
|
-
put(actions.resetLoginState());
|
|
116
|
-
const redirectUrl = getRedirectUrl({
|
|
117
|
-
authenticatedUrl: customLoginAuthenticatedUrl ? getPathAndSearchParamsFromUrl(customLoginAuthenticatedUrl) : authenticatedUrl,
|
|
118
|
-
includeQueryParam,
|
|
119
|
-
enforceRedirectToSameSite,
|
|
120
|
-
allowedRedirectOrigins
|
|
121
|
-
});
|
|
122
|
-
onRedirectTo(redirectUrl, {
|
|
123
|
-
refresh: redirectUrl.startsWith('http')
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
export function* refreshMetadata() {
|
|
127
|
-
let ssoACS;
|
|
128
|
-
try {
|
|
129
|
-
var _metadata$configurati;
|
|
130
|
-
const metadata = yield call(api.metadata.getSamlMetadata);
|
|
131
|
-
ssoACS = metadata == null ? void 0 : (_metadata$configurati = metadata.configuration) == null ? void 0 : _metadata$configurati.acsUrl;
|
|
132
|
-
} catch (e) {
|
|
133
|
-
console.error(e);
|
|
134
|
-
}
|
|
135
|
-
yield put(actions.setState({
|
|
136
|
-
ssoACS
|
|
137
|
-
}));
|
|
138
|
-
}
|
|
139
|
-
export function* loadSSOPublicConfigurationFunction() {
|
|
140
|
-
try {
|
|
141
|
-
const {
|
|
142
|
-
isActive
|
|
143
|
-
} = yield call(api.auth.getSSOPublicConfiguration);
|
|
144
|
-
yield put(actions.setState({
|
|
145
|
-
isSSOAuth: isActive
|
|
146
|
-
}));
|
|
147
|
-
} catch (e) {
|
|
148
|
-
console.error(e);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
function* shouldNevigateToRegisterQuickLogin(user) {
|
|
152
|
-
var _ref;
|
|
153
|
-
const {
|
|
154
|
-
routes,
|
|
155
|
-
loginState
|
|
156
|
-
} = yield select(state => state.auth);
|
|
157
|
-
const quickLoginToRegister = (_ref = localStorage.getItem('register-quick-login')) != null ? _ref : loginState.quickLoginToRegister;
|
|
158
|
-
return quickLoginToRegister && localStorage.getItem(`${user.id}-${quickLoginToRegister}`) !== 'true' && !window.location.pathname.endsWith(routes.logoutUrl);
|
|
159
|
-
}
|
|
160
|
-
export function* refreshToken() {
|
|
161
|
-
const {
|
|
162
|
-
hostedLoginBox
|
|
163
|
-
} = yield select(state => state.auth);
|
|
164
|
-
if (hostedLoginBox) {
|
|
165
|
-
yield call(refreshTokenHosted);
|
|
166
|
-
} else {
|
|
167
|
-
yield call(refreshTokenEmbedded);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
export function* refreshTokenForSocialLogins() {
|
|
171
|
-
const {
|
|
172
|
-
hostedLoginBox
|
|
173
|
-
} = yield select(state => state.auth);
|
|
174
|
-
if (hostedLoginBox) {
|
|
175
|
-
yield call(refreshTokenHostedSocialLogins);
|
|
176
|
-
} else {
|
|
177
|
-
yield call(refreshTokenEmbeddedSocialLogins);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
function* refreshTokenHosted() {
|
|
181
|
-
const {
|
|
182
|
-
user
|
|
183
|
-
} = yield select(state => state.auth);
|
|
184
|
-
if (!(user != null && user.refreshToken)) {
|
|
185
|
-
ContextHolder.setAccessToken(null);
|
|
186
|
-
ContextHolder.setUser(null);
|
|
187
|
-
yield put(actions.setState({
|
|
188
|
-
user: null,
|
|
189
|
-
isAuthenticated: false
|
|
190
|
-
}));
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
try {
|
|
194
|
-
const body = {
|
|
195
|
-
grant_type: 'refresh_token',
|
|
196
|
-
refresh_token: user == null ? void 0 : user.refreshToken
|
|
197
|
-
};
|
|
198
|
-
const response = yield call(api.auth.exchangeOAuthTokensV2, body);
|
|
199
|
-
const updatedUser = yield call(handleUnnecessaryEntitlementsUpdate, response.user);
|
|
200
|
-
yield call(afterAuthenticationStateUpdate, _extends({}, response, {
|
|
201
|
-
user: updatedUser
|
|
202
|
-
}), {
|
|
203
|
-
isAuthenticated: true
|
|
204
|
-
});
|
|
205
|
-
} catch (e) {
|
|
206
|
-
ContextHolder.setAccessToken(null);
|
|
207
|
-
ContextHolder.setUser(null);
|
|
208
|
-
yield put(actions.setState({
|
|
209
|
-
user: null,
|
|
210
|
-
isAuthenticated: false
|
|
211
|
-
}));
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
function* refreshTokenHostedSocialLogins() {
|
|
215
|
-
const {
|
|
216
|
-
user: currentUser
|
|
217
|
-
} = yield select(state => state.auth);
|
|
218
|
-
if (!(currentUser != null && currentUser.refreshToken)) {
|
|
219
|
-
ContextHolder.setAccessToken(null);
|
|
220
|
-
ContextHolder.setUser(null);
|
|
221
|
-
yield put(actions.setState({
|
|
222
|
-
user: null,
|
|
223
|
-
isAuthenticated: false
|
|
224
|
-
}));
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
try {
|
|
228
|
-
const body = {
|
|
229
|
-
grant_type: 'refresh_token',
|
|
230
|
-
refresh_token: currentUser == null ? void 0 : currentUser.refreshToken
|
|
231
|
-
};
|
|
232
|
-
const response = yield call(api.auth.exchangeOAuthTokensV2, body);
|
|
233
|
-
const updatedUser = yield call(handleUnnecessaryEntitlementsUpdate, response.user);
|
|
234
|
-
yield call(afterAuthenticationStateUpdate, _extends({}, response, {
|
|
235
|
-
user: updatedUser
|
|
236
|
-
}), {
|
|
237
|
-
isAuthenticated: true
|
|
238
|
-
});
|
|
239
|
-
} catch (e) {
|
|
240
|
-
ContextHolder.setAccessToken(null);
|
|
241
|
-
ContextHolder.setUser(null);
|
|
242
|
-
yield put(actions.setState({
|
|
243
|
-
user: null,
|
|
244
|
-
isAuthenticated: false
|
|
245
|
-
}));
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
function* refreshTokenEmbedded() {
|
|
249
|
-
try {
|
|
250
|
-
const onRedirectTo = ContextHolder.onRedirectTo;
|
|
251
|
-
const {
|
|
252
|
-
routes,
|
|
253
|
-
loginState
|
|
254
|
-
} = yield select(state => state.auth);
|
|
255
|
-
const {
|
|
256
|
-
user,
|
|
257
|
-
tenants = [],
|
|
258
|
-
activeTenant
|
|
259
|
-
} = yield call(api.auth.refreshTokenV3);
|
|
260
|
-
if (isMfaRequired(user)) {
|
|
261
|
-
const mfaRequiredState = yield getMfaRequiredState(user);
|
|
262
|
-
yield put(actions.setState(mfaRequiredState));
|
|
263
|
-
onRedirectTo(routes.loginUrl, {
|
|
264
|
-
preserveQueryParams: true
|
|
265
|
-
});
|
|
266
|
-
} else {
|
|
267
|
-
var _ref2;
|
|
268
|
-
if (user.id) {
|
|
269
|
-
localStorage.setItem('userId', user.id);
|
|
270
|
-
}
|
|
271
|
-
const quickLoginToRegister = (_ref2 = localStorage.getItem('register-quick-login')) != null ? _ref2 : loginState.quickLoginToRegister;
|
|
272
|
-
const shouldNavigateToRegisterQuickLogin = yield shouldNevigateToRegisterQuickLogin(user);
|
|
273
|
-
const updatedUser = yield call(handleUnnecessaryEntitlementsUpdate, user);
|
|
274
|
-
yield call(afterAuthenticationStateUpdate, {
|
|
275
|
-
user: updatedUser,
|
|
276
|
-
tenants,
|
|
277
|
-
activeTenant
|
|
278
|
-
}, {
|
|
279
|
-
loginState: _extends({}, loginState, {
|
|
280
|
-
quickLoginToRegister,
|
|
281
|
-
flow: shouldNavigateToRegisterQuickLogin ? LoginFlow.RegisterQuickLogin : LoginFlow.Login
|
|
282
|
-
}),
|
|
283
|
-
isAuthenticated: true
|
|
284
|
-
});
|
|
285
|
-
yield handleRedirectRefreshToken(shouldNavigateToRegisterQuickLogin);
|
|
286
|
-
}
|
|
287
|
-
} catch (e) {
|
|
288
|
-
ContextHolder.setAccessToken(null);
|
|
289
|
-
ContextHolder.setUser(null);
|
|
290
|
-
yield put(actions.setState({
|
|
291
|
-
user: undefined,
|
|
292
|
-
isAuthenticated: false
|
|
293
|
-
}));
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
function* refreshTokenEmbeddedSocialLogins() {
|
|
297
|
-
try {
|
|
298
|
-
const onRedirectTo = ContextHolder.onRedirectTo;
|
|
299
|
-
const {
|
|
300
|
-
routes,
|
|
301
|
-
loginState
|
|
302
|
-
} = yield select(state => state.auth);
|
|
303
|
-
const {
|
|
304
|
-
user,
|
|
305
|
-
tenants = [],
|
|
306
|
-
activeTenant
|
|
307
|
-
} = yield call(api.auth.refreshTokenV3);
|
|
308
|
-
if (isMfaRequired(user)) {
|
|
309
|
-
const mfaRequiredState = yield getMfaRequiredState(user);
|
|
310
|
-
yield put(actions.setState(mfaRequiredState));
|
|
311
|
-
onRedirectTo(routes.loginUrl, {
|
|
312
|
-
preserveQueryParams: true
|
|
313
|
-
});
|
|
314
|
-
} else {
|
|
315
|
-
const updatedUser = yield call(handleUnnecessaryEntitlementsUpdate, user);
|
|
316
|
-
const shouldShowPrompt = yield call(shouldShowPromptPasskeys);
|
|
317
|
-
if (shouldShowPrompt) {
|
|
318
|
-
yield put(actions.setLoginState({
|
|
319
|
-
step: LoginStep.promptPasskeys,
|
|
320
|
-
loading: false
|
|
321
|
-
}));
|
|
322
|
-
yield call(afterAuthenticationStateUpdate, {
|
|
323
|
-
user: updatedUser,
|
|
324
|
-
tenants,
|
|
325
|
-
activeTenant
|
|
326
|
-
}, {
|
|
327
|
-
isLoading: false
|
|
328
|
-
});
|
|
329
|
-
onRedirectTo(routes.loginUrl, {
|
|
330
|
-
preserveQueryParams: true
|
|
331
|
-
});
|
|
332
|
-
} else {
|
|
333
|
-
var _ref3;
|
|
334
|
-
if (user.id) {
|
|
335
|
-
localStorage.setItem('userId', user.id);
|
|
336
|
-
}
|
|
337
|
-
const quickLoginToRegister = (_ref3 = localStorage.getItem('register-quick-login')) != null ? _ref3 : loginState.quickLoginToRegister;
|
|
338
|
-
const shouldNavigateToRegisterQuickLogin = yield shouldNevigateToRegisterQuickLogin(user);
|
|
339
|
-
yield call(afterAuthenticationStateUpdate, {
|
|
340
|
-
user: updatedUser,
|
|
341
|
-
tenants,
|
|
342
|
-
activeTenant
|
|
343
|
-
}, {
|
|
344
|
-
loginState: _extends({}, loginState, {
|
|
345
|
-
quickLoginToRegister,
|
|
346
|
-
flow: shouldNavigateToRegisterQuickLogin ? LoginFlow.RegisterQuickLogin : LoginFlow.Login
|
|
347
|
-
}),
|
|
348
|
-
isAuthenticated: true
|
|
349
|
-
});
|
|
350
|
-
yield handleRedirectRefreshToken(shouldNavigateToRegisterQuickLogin);
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
} catch (e) {
|
|
354
|
-
ContextHolder.setAccessToken(null);
|
|
355
|
-
ContextHolder.setUser(null);
|
|
356
|
-
yield put(actions.setState({
|
|
357
|
-
user: undefined,
|
|
358
|
-
isAuthenticated: false
|
|
359
|
-
}));
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
function* handleRedirectRefreshToken(shouldNavigateToRegisterQuickLogin) {
|
|
363
|
-
var _window;
|
|
364
|
-
const url = new URL((_window = window) == null ? void 0 : _window.location.href);
|
|
365
|
-
const onRedirectTo = ContextHolder.onRedirectTo;
|
|
366
|
-
const {
|
|
367
|
-
routes,
|
|
368
|
-
loginState
|
|
369
|
-
} = yield select(state => state.auth);
|
|
370
|
-
const invitationToken = url.searchParams.get('invitationToken');
|
|
371
|
-
const redirectRoutes = [routes.socialLoginCallbackUrl, routes.oidcRedirectUrl, routes.samlCallbackUrl];
|
|
372
|
-
if (!invitationToken) {
|
|
373
|
-
redirectRoutes.push(routes.loginUrl, routes.signUpUrl);
|
|
374
|
-
}
|
|
375
|
-
if (shouldNavigateToRegisterQuickLogin) {
|
|
376
|
-
onRedirectTo(routes.loginUrl);
|
|
377
|
-
} else if (redirectRoutes.some(url => url && window.location.pathname.endsWith(url))) {
|
|
378
|
-
if (loginState.isNewUser && routes.signUpSuccessUrl && routes.socialLoginCallbackUrl === window.location.pathname) {
|
|
379
|
-
onRedirectTo(routes.signUpSuccessUrl, {
|
|
380
|
-
refresh: routes.signUpSuccessUrl.startsWith('http')
|
|
381
|
-
});
|
|
382
|
-
} else {
|
|
383
|
-
yield afterAuthNavigation();
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
function* getUserIP({
|
|
388
|
-
payload: {
|
|
389
|
-
callback
|
|
390
|
-
}
|
|
391
|
-
}) {
|
|
392
|
-
try {
|
|
393
|
-
const {
|
|
394
|
-
ip
|
|
395
|
-
} = yield call(api.metadata.getCurrentUserIpMetadata);
|
|
396
|
-
yield put(actions.setState({
|
|
397
|
-
userIp: ip
|
|
398
|
-
}));
|
|
399
|
-
callback == null ? void 0 : callback(true);
|
|
400
|
-
} catch (e) {
|
|
401
|
-
callback == null ? void 0 : callback(false);
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
function* requestAuthorize({
|
|
405
|
-
payload: firstTime
|
|
406
|
-
}) {
|
|
407
|
-
const calls = [];
|
|
408
|
-
const isCustomLoginEnabled = yield call(customLoginEnabled);
|
|
409
|
-
if (isCustomLoginEnabled) {
|
|
410
|
-
/*
|
|
411
|
-
// waiting for refreshToken to be loaded is only necessary for custom login
|
|
412
|
-
// but doing this will degrade the loading performance in around 500 ms
|
|
413
|
-
// so we will wait for the refreshToken only if there is tenantResolver
|
|
414
|
-
*/
|
|
415
|
-
yield call(refreshToken);
|
|
416
|
-
} else {
|
|
417
|
-
calls.push(call(refreshToken));
|
|
418
|
-
}
|
|
419
|
-
if (firstTime) {
|
|
420
|
-
yield put(actions.setState({
|
|
421
|
-
isLoading: true
|
|
422
|
-
}));
|
|
423
|
-
yield put(actions.loadSocialLoginsConfigurationV2());
|
|
424
|
-
calls.push(call(loadAllowSignUps));
|
|
425
|
-
calls.push(call(loadPublicAuthStrategiesPolicy));
|
|
426
|
-
calls.push(call(loadSSOPublicConfigurationFunction));
|
|
427
|
-
calls.push(call(loadVendorPublicInfo));
|
|
428
|
-
calls.push(call(refreshMetadata));
|
|
429
|
-
calls.push(call(loadCustomLoginRoutes));
|
|
430
|
-
}
|
|
431
|
-
yield all(calls);
|
|
432
|
-
yield put(actions.setState({
|
|
433
|
-
isLoading: false
|
|
434
|
-
}));
|
|
435
|
-
}
|
|
436
|
-
function* isMFARequiredSSR({
|
|
437
|
-
accessToken,
|
|
438
|
-
user
|
|
439
|
-
}) {
|
|
440
|
-
if (!accessToken) {
|
|
441
|
-
yield put(actions.setState({
|
|
442
|
-
user: undefined,
|
|
443
|
-
isAuthenticated: false
|
|
444
|
-
}));
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
const onRedirectTo = ContextHolder.onRedirectTo;
|
|
448
|
-
const {
|
|
449
|
-
routes
|
|
450
|
-
} = yield select(state => state.auth);
|
|
451
|
-
if (isMfaRequired(user)) {
|
|
452
|
-
const mfaRequiredState = yield getMfaRequiredState(user);
|
|
453
|
-
yield put(actions.setState(mfaRequiredState));
|
|
454
|
-
onRedirectTo(routes.loginUrl, {
|
|
455
|
-
preserveQueryParams: true
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
function* requestAuthorizeSSR({
|
|
460
|
-
payload
|
|
461
|
-
}) {
|
|
462
|
-
const calls = [];
|
|
463
|
-
yield put(actions.loadSocialLoginsConfigurationV2());
|
|
464
|
-
calls.push(call(loadAllowSignUps));
|
|
465
|
-
calls.push(call(loadSSOPublicConfigurationFunction));
|
|
466
|
-
calls.push(call(loadVendorPublicInfo));
|
|
467
|
-
calls.push(call(refreshMetadata));
|
|
468
|
-
calls.push(call(isMFARequiredSSR, payload));
|
|
469
|
-
calls.push(call(loadCustomLoginRoutes));
|
|
470
|
-
yield all(calls);
|
|
471
|
-
}
|
|
472
|
-
const getUri = urlStrategy => {
|
|
473
|
-
if (urlStrategy === 'path') {
|
|
474
|
-
var _window2;
|
|
475
|
-
return ((_window2 = window) != null ? _window2 : document).location.pathname;
|
|
476
|
-
} else {
|
|
477
|
-
var _window3;
|
|
478
|
-
const uri = (((_window3 = window) != null ? _window3 : document).location.hash || '#').substring(1);
|
|
479
|
-
if (uri.indexOf('?') !== -1) {
|
|
480
|
-
return uri.substring(0, uri.indexOf('?'));
|
|
481
|
-
} else {
|
|
482
|
-
return uri;
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
};
|
|
486
|
-
function* requestHostedLoginSilentAuthorize() {
|
|
487
|
-
const response = yield call(api.auth.silentOAuthRefreshTokenV2);
|
|
488
|
-
if (response != null && response.user) {
|
|
489
|
-
yield call(afterAuthenticationStateUpdate, response, {
|
|
490
|
-
isAuthenticated: true,
|
|
491
|
-
isLoading: false
|
|
492
|
-
});
|
|
493
|
-
} else {
|
|
494
|
-
throw new Error(`couldn't refresh user token with oauth service`);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
function* refreshOrRequestHostedLoginAuthorize({
|
|
498
|
-
payload: additionalParams
|
|
499
|
-
}) {
|
|
500
|
-
const {
|
|
501
|
-
disableSilentRefresh
|
|
502
|
-
} = yield select(state => ({
|
|
503
|
-
disableSilentRefresh: state.auth.disableSilentRefresh
|
|
504
|
-
}));
|
|
505
|
-
try {
|
|
506
|
-
if (disableSilentRefresh) {
|
|
507
|
-
throw new Error('silent refresh is disabled');
|
|
508
|
-
}
|
|
509
|
-
yield requestHostedLoginSilentAuthorize();
|
|
510
|
-
} catch (e) {
|
|
511
|
-
yield requestHostedLoginAuthorize(additionalParams);
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
function* refreshOrRequestHostedLoginAuthorizeV2({
|
|
515
|
-
payload: {
|
|
516
|
-
additionalParams,
|
|
517
|
-
shouldRedirectToLogin,
|
|
518
|
-
firstTime
|
|
519
|
-
}
|
|
520
|
-
}) {
|
|
521
|
-
if (firstTime) {
|
|
522
|
-
const {
|
|
523
|
-
urlStrategy
|
|
524
|
-
} = yield select(state => ({
|
|
525
|
-
urlStrategy: state.root.urlStrategy
|
|
526
|
-
}));
|
|
527
|
-
const activeUri = getUri(urlStrategy);
|
|
528
|
-
yield put(actions.setState({
|
|
529
|
-
isLoading: true
|
|
530
|
-
}));
|
|
531
|
-
if (isOauthCallbackRoute(activeUri)) {
|
|
532
|
-
return;
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
const {
|
|
536
|
-
disableSilentRefresh
|
|
537
|
-
} = yield select(state => ({
|
|
538
|
-
disableSilentRefresh: state.auth.disableSilentRefresh
|
|
539
|
-
}));
|
|
540
|
-
try {
|
|
541
|
-
if (disableSilentRefresh) {
|
|
542
|
-
throw new Error('silent refresh is disabled');
|
|
543
|
-
}
|
|
544
|
-
yield requestHostedLoginSilentAuthorize();
|
|
545
|
-
} catch (e) {
|
|
546
|
-
if (!shouldRedirectToLogin) {
|
|
547
|
-
yield put(actions.setState({
|
|
548
|
-
isLoading: false
|
|
549
|
-
}));
|
|
550
|
-
return;
|
|
551
|
-
}
|
|
552
|
-
yield requestHostedLoginAuthorize(additionalParams);
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
function* requestHostedLoginAuthorize(additionalParams) {
|
|
556
|
-
const {
|
|
557
|
-
routes,
|
|
558
|
-
context,
|
|
559
|
-
onRedirectTo,
|
|
560
|
-
urlStrategy
|
|
561
|
-
} = yield select(state => ({
|
|
562
|
-
routes: state.auth.routes,
|
|
563
|
-
onRedirectTo: state.auth.onRedirectTo,
|
|
564
|
-
context: state.root.context,
|
|
565
|
-
urlStrategy: state.root.urlStrategy
|
|
566
|
-
}));
|
|
567
|
-
const activeUri = getUri(urlStrategy);
|
|
568
|
-
if (activeUri === routes.hostedLoginRedirectUrl) {
|
|
569
|
-
console.debug('Calling loginWithRedirect while in hostedLoginCallback route');
|
|
570
|
-
return;
|
|
571
|
-
}
|
|
572
|
-
yield put(actions.setState({
|
|
573
|
-
isLoading: true
|
|
574
|
-
}));
|
|
575
|
-
// Generate the relevant params for the redirect
|
|
576
|
-
const nonce = createRandomString();
|
|
577
|
-
const code_verifier = createRandomString();
|
|
578
|
-
const code_challenge = yield call(generateCodeChallenge, code_verifier);
|
|
579
|
-
|
|
580
|
-
// We are saving the verifier in session storage to be able to validate the response
|
|
581
|
-
localStorage.setItem(HOSTED_LOGIN_VERIFIER_KEY, code_verifier);
|
|
582
|
-
let redirectUrl = `${window.location.origin}${urlStrategy === 'path' ? '' : '#'}${routes.hostedLoginRedirectUrl}`;
|
|
583
|
-
yield call(loadCustomLoginRoutes);
|
|
584
|
-
const customLoginSearchParam = yield select(state => {
|
|
585
|
-
var _state$auth$customLog;
|
|
586
|
-
return (_state$auth$customLog = state.auth.customLoginState) == null ? void 0 : _state$auth$customLog.customLoginSearchParams;
|
|
587
|
-
});
|
|
588
|
-
if (customLoginSearchParam) {
|
|
589
|
-
if (redirectUrl.endsWith('/')) {
|
|
590
|
-
redirectUrl = redirectUrl.slice(0, -1);
|
|
591
|
-
}
|
|
592
|
-
redirectUrl += customLoginSearchParam;
|
|
593
|
-
}
|
|
594
|
-
const baseUrl = fetch.getBaseUrl(context, '/oauth/authorize');
|
|
595
|
-
// Hard coded for now
|
|
596
|
-
const oauthUrl = `${baseUrl}/oauth/authorize`;
|
|
597
|
-
const params = _extends({
|
|
598
|
-
response_type: 'code',
|
|
599
|
-
client_id: context.clientId || 'INVALID-CLIENT-ID',
|
|
600
|
-
scope: 'openid email profile',
|
|
601
|
-
redirect_uri: redirectUrl,
|
|
602
|
-
code_challenge: code_challenge,
|
|
603
|
-
code_challenge_method: 'S256',
|
|
604
|
-
nonce
|
|
605
|
-
}, additionalParams);
|
|
606
|
-
if (context.tenantResolver) {
|
|
607
|
-
var _context$tenantResolv;
|
|
608
|
-
const resolvedTenantResult = yield (_context$tenantResolv = context.tenantResolver) == null ? void 0 : _context$tenantResolv.call(context);
|
|
609
|
-
if (resolvedTenantResult != null && resolvedTenantResult.tenant) {
|
|
610
|
-
params['organization'] = resolvedTenantResult.tenant;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
const tenantId = getSearchParam(TENANT_ID_PARAM_KEY);
|
|
614
|
-
if (tenantId) {
|
|
615
|
-
params['tenantId'] = tenantId;
|
|
616
|
-
}
|
|
617
|
-
const searchParams = new URLSearchParams(params);
|
|
618
|
-
const url = `${oauthUrl}?${searchParams.toString()}`;
|
|
619
|
-
onRedirectTo(url, {
|
|
620
|
-
refresh: true
|
|
621
|
-
});
|
|
622
|
-
}
|
|
623
|
-
function* handleHostedLoginCallback({
|
|
624
|
-
payload
|
|
625
|
-
}) {
|
|
626
|
-
// Hard coded for now
|
|
627
|
-
const code_verifier = localStorage.getItem(HOSTED_LOGIN_VERIFIER_KEY) || 'INVALID-CODE-VERIFIER';
|
|
628
|
-
const {
|
|
629
|
-
routes,
|
|
630
|
-
urlStrategy
|
|
631
|
-
} = yield select(state => ({
|
|
632
|
-
routes: state.auth.routes,
|
|
633
|
-
urlStrategy: state.root.urlStrategy
|
|
634
|
-
}));
|
|
635
|
-
let redirectUrl = `${window.location.origin}${urlStrategy === 'path' ? '' : '#'}${routes.hostedLoginRedirectUrl}`;
|
|
636
|
-
yield call(loadCustomLoginRoutes);
|
|
637
|
-
const customLoginSearchParam = yield select(state => {
|
|
638
|
-
var _state$auth$customLog2;
|
|
639
|
-
return (_state$auth$customLog2 = state.auth.customLoginState) == null ? void 0 : _state$auth$customLog2.customLoginSearchParams;
|
|
640
|
-
});
|
|
641
|
-
if (customLoginSearchParam) {
|
|
642
|
-
if (redirectUrl.endsWith('/')) {
|
|
643
|
-
redirectUrl = redirectUrl.slice(0, -1);
|
|
644
|
-
}
|
|
645
|
-
redirectUrl += customLoginSearchParam;
|
|
646
|
-
}
|
|
647
|
-
const body = {
|
|
648
|
-
code: payload.code,
|
|
649
|
-
redirect_uri: redirectUrl,
|
|
650
|
-
code_verifier,
|
|
651
|
-
grant_type: 'authorization_code'
|
|
652
|
-
};
|
|
653
|
-
try {
|
|
654
|
-
const response = yield call(api.auth.exchangeOAuthTokensV2, body);
|
|
655
|
-
yield call(afterAuthenticationStateUpdate, response, {
|
|
656
|
-
isAuthenticated: true,
|
|
657
|
-
isLoading: false
|
|
658
|
-
});
|
|
659
|
-
} catch (e) {
|
|
660
|
-
yield put(actions.setState({
|
|
661
|
-
isLoading: false
|
|
662
|
-
}));
|
|
663
|
-
console.error('Failed to exchangeOAuthTokens', e);
|
|
664
|
-
} finally {
|
|
665
|
-
yield afterAuthNavigation();
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
function* changePhoneNumberWithVerification(_ref4) {
|
|
669
|
-
let {
|
|
670
|
-
payload: {
|
|
671
|
-
callback
|
|
672
|
-
}
|
|
673
|
-
} = _ref4,
|
|
674
|
-
payload = _objectWithoutPropertiesLoose(_ref4.payload, _excluded);
|
|
675
|
-
try {
|
|
676
|
-
yield put(actions.setLoginState({
|
|
677
|
-
loading: true
|
|
678
|
-
}));
|
|
679
|
-
const changePhoneRes = yield call(api.auth.changePhoneNumberWithVerification, payload);
|
|
680
|
-
yield put(actions.setLoginState({
|
|
681
|
-
phoneNumber: payload.phoneNumber,
|
|
682
|
-
loading: false,
|
|
683
|
-
changePhoneId: changePhoneRes.changePhoneId,
|
|
684
|
-
step: LoginStep.loginWithQuickSmsOtc,
|
|
685
|
-
error: undefined
|
|
686
|
-
}));
|
|
687
|
-
callback == null ? void 0 : callback(true);
|
|
688
|
-
} catch (e) {
|
|
689
|
-
yield put(actions.setLoginState({
|
|
690
|
-
error: errorHandler(e),
|
|
691
|
-
loading: false
|
|
692
|
-
}));
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
function* verifyChangePhoneNumber(_ref5) {
|
|
696
|
-
let {
|
|
697
|
-
payload: {
|
|
698
|
-
callback
|
|
699
|
-
}
|
|
700
|
-
} = _ref5,
|
|
701
|
-
payload = _objectWithoutPropertiesLoose(_ref5.payload, _excluded2);
|
|
702
|
-
try {
|
|
703
|
-
yield put(actions.setLoginState({
|
|
704
|
-
loading: true
|
|
705
|
-
}));
|
|
706
|
-
yield call(api.auth.verifyChangePhoneNumber, payload);
|
|
707
|
-
yield put(actions.setLoginState({
|
|
708
|
-
loading: false
|
|
709
|
-
}));
|
|
710
|
-
callback == null ? void 0 : callback(true);
|
|
711
|
-
} catch (e) {
|
|
712
|
-
yield put(actions.setLoginState({
|
|
713
|
-
error: errorHandler(e),
|
|
714
|
-
loading: false
|
|
715
|
-
}));
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
function* quickSmsPasswordlessPreLogin(_ref6) {
|
|
719
|
-
let {
|
|
720
|
-
payload: {
|
|
721
|
-
callback
|
|
722
|
-
}
|
|
723
|
-
} = _ref6,
|
|
724
|
-
payload = _objectWithoutPropertiesLoose(_ref6.payload, _excluded3);
|
|
725
|
-
try {
|
|
726
|
-
yield put(actions.setLoginState({
|
|
727
|
-
loading: true
|
|
728
|
-
}));
|
|
729
|
-
|
|
730
|
-
// TODO: [Typescript 4.8] fix @frontegg/rest-api return value
|
|
731
|
-
// @ts-ignore
|
|
732
|
-
const preloginRes = yield call(api.auth.passwordlessPreLogin, _extends({}, payload, {
|
|
733
|
-
type: AuthStrategyEnum.SmsCode
|
|
734
|
-
}));
|
|
735
|
-
yield put(actions.setLoginState({
|
|
736
|
-
step: LoginStep.loginWithQuickSmsOtc,
|
|
737
|
-
loading: false,
|
|
738
|
-
phoneNumber: preloginRes == null ? void 0 : preloginRes.phoneNumber,
|
|
739
|
-
error: undefined
|
|
740
|
-
}));
|
|
741
|
-
callback == null ? void 0 : callback(true);
|
|
742
|
-
} catch (e) {
|
|
743
|
-
yield put(actions.setLoginState({
|
|
744
|
-
error: errorHandler(e),
|
|
745
|
-
loading: false
|
|
746
|
-
}));
|
|
747
|
-
callback == null ? void 0 : callback(e);
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
function* passwordlessPreLogin(_ref7) {
|
|
751
|
-
let {
|
|
752
|
-
payload: {
|
|
753
|
-
callback
|
|
754
|
-
}
|
|
755
|
-
} = _ref7,
|
|
756
|
-
payload = _objectWithoutPropertiesLoose(_ref7.payload, _excluded4);
|
|
757
|
-
try {
|
|
758
|
-
const {
|
|
759
|
-
onRedirectTo,
|
|
760
|
-
routes
|
|
761
|
-
} = yield select(({
|
|
762
|
-
auth: {
|
|
763
|
-
onRedirectTo,
|
|
764
|
-
routes
|
|
765
|
-
}
|
|
766
|
-
}) => ({
|
|
767
|
-
onRedirectTo,
|
|
768
|
-
routes
|
|
769
|
-
}));
|
|
770
|
-
yield put(actions.setLoginState({
|
|
771
|
-
loading: true
|
|
772
|
-
}));
|
|
773
|
-
|
|
774
|
-
// TODO: [Typescript 4.8] fix @frontegg/rest-api return value
|
|
775
|
-
// @ts-ignore
|
|
776
|
-
const preloginRes = yield call(api.auth.passwordlessPreLogin, payload);
|
|
777
|
-
const step = authStrategyLoginStepMap[payload.type];
|
|
778
|
-
if (step === LoginStep.loginWithSmsOtc && preloginRes.resetPhoneNumberToken) {
|
|
779
|
-
yield put(actions.setResetPhoneNumberState({
|
|
780
|
-
resetPhoneNumberToken: preloginRes.resetPhoneNumberToken,
|
|
781
|
-
step: ResetPhoneNumberStep.VerifyResetPhoneNumber
|
|
782
|
-
}));
|
|
783
|
-
onRedirectTo(routes.resetPhoneNumberUrl);
|
|
784
|
-
return;
|
|
785
|
-
}
|
|
786
|
-
yield put(actions.setLoginState({
|
|
787
|
-
step,
|
|
788
|
-
loading: false,
|
|
789
|
-
phoneNumber: preloginRes == null ? void 0 : preloginRes.phoneNumber,
|
|
790
|
-
email: payload.email,
|
|
791
|
-
error: undefined
|
|
792
|
-
}));
|
|
793
|
-
callback == null ? void 0 : callback();
|
|
794
|
-
} catch (e) {
|
|
795
|
-
yield put(actions.setLoginState({
|
|
796
|
-
error: errorHandler(e),
|
|
797
|
-
loading: false
|
|
798
|
-
}));
|
|
799
|
-
callback == null ? void 0 : callback();
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
export function* shouldShowPromptPasskeys() {
|
|
803
|
-
const {
|
|
804
|
-
publicAuthStrategyPolicy
|
|
805
|
-
} = yield select(state => state.auth.securityPolicyState);
|
|
806
|
-
const {
|
|
807
|
-
policy
|
|
808
|
-
} = publicAuthStrategyPolicy;
|
|
809
|
-
const isPasskeysEnabledByVendor = getPasskeysVendorPolicy(policy);
|
|
810
|
-
const isLoggedInWithPasskeys = localStorage.getItem('preferred-login-method') === 'Passkeys';
|
|
811
|
-
const isMarkedDontShowAgainPrompt = localStorage.getItem('dont-show-again-prompt-passkeys') === 'true';
|
|
812
|
-
const [showPasskeys] = yield call(getFeatureFlags, ['show-passkeys-new']);
|
|
813
|
-
if (!showPasskeys || !isPasskeysEnabledByVendor || isLoggedInWithPasskeys || isMarkedDontShowAgainPrompt) {
|
|
814
|
-
return false;
|
|
815
|
-
} else {
|
|
816
|
-
const {
|
|
817
|
-
devices
|
|
818
|
-
} = yield call(api.auth.getWebAuthnDevices);
|
|
819
|
-
yield put(actions.setPasskeysState({
|
|
820
|
-
devices: devices != null ? devices : []
|
|
821
|
-
}));
|
|
822
|
-
const numOfDevices = !(devices != null && devices.length) ? 0 : devices.length;
|
|
823
|
-
return numOfDevices === 0;
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
function* passwordlessPostLogin(_ref8) {
|
|
827
|
-
let {
|
|
828
|
-
payload: {
|
|
829
|
-
callback,
|
|
830
|
-
events
|
|
831
|
-
}
|
|
832
|
-
} = _ref8,
|
|
833
|
-
payload = _objectWithoutPropertiesLoose(_ref8.payload, _excluded5);
|
|
834
|
-
try {
|
|
835
|
-
yield put(actions.setLoginState({
|
|
836
|
-
loading: true
|
|
837
|
-
}));
|
|
838
|
-
const {
|
|
839
|
-
user,
|
|
840
|
-
tenants = [],
|
|
841
|
-
activeTenant
|
|
842
|
-
} = yield call(api.auth.passwordlessPostLoginV2, payload);
|
|
843
|
-
const onRedirectTo = ContextHolder.onRedirectTo;
|
|
844
|
-
const {
|
|
845
|
-
routes
|
|
846
|
-
} = yield select(state => state.auth);
|
|
847
|
-
if (isMfaRequired(user)) {
|
|
848
|
-
const mfaRequiredState = yield getMfaRequiredState(user);
|
|
849
|
-
yield put(actions.setState(mfaRequiredState));
|
|
850
|
-
onRedirectTo(routes.loginUrl, {
|
|
851
|
-
preserveQueryParams: true
|
|
852
|
-
});
|
|
853
|
-
} else {
|
|
854
|
-
const {
|
|
855
|
-
loginState
|
|
856
|
-
} = yield select(state => state.auth);
|
|
857
|
-
if (user.emailVerified) {
|
|
858
|
-
var _events$userVerified;
|
|
859
|
-
const userVerifiedPayload = {
|
|
860
|
-
email: user.email,
|
|
861
|
-
origin: UserVeirifedOriginTypes.PASSWORDLESS,
|
|
862
|
-
id: user.id,
|
|
863
|
-
tenantId: user.tenantId,
|
|
864
|
-
createdAt: new Date(),
|
|
865
|
-
name: user.name
|
|
866
|
-
};
|
|
867
|
-
events == null ? void 0 : (_events$userVerified = events.userVerified) == null ? void 0 : _events$userVerified.call(events, userVerifiedPayload);
|
|
868
|
-
reportGTMEvent(GTMEventAction.USER_VERIFIED, userVerifiedPayload);
|
|
869
|
-
}
|
|
870
|
-
if (user.id) {
|
|
871
|
-
localStorage.setItem('userId', user.id);
|
|
872
|
-
}
|
|
873
|
-
yield call(afterAuthenticationStateUpdate, {
|
|
874
|
-
user,
|
|
875
|
-
tenants,
|
|
876
|
-
activeTenant
|
|
877
|
-
});
|
|
878
|
-
yield put(actions.setLoginState({
|
|
879
|
-
error: undefined
|
|
880
|
-
}));
|
|
881
|
-
yield put(actions.setState({
|
|
882
|
-
isLoading: false
|
|
883
|
-
}));
|
|
884
|
-
if (loginState.flow === LoginFlow.Login) {
|
|
885
|
-
const shouldShowPrompt = yield call(shouldShowPromptPasskeys);
|
|
886
|
-
if (shouldShowPrompt) {
|
|
887
|
-
yield put(actions.setLoginState({
|
|
888
|
-
step: LoginStep.promptPasskeys,
|
|
889
|
-
loading: false
|
|
890
|
-
}));
|
|
891
|
-
onRedirectTo(routes.loginUrl, {
|
|
892
|
-
preserveQueryParams: true
|
|
893
|
-
});
|
|
894
|
-
} else {
|
|
895
|
-
yield put(actions.setState({
|
|
896
|
-
isAuthenticated: true
|
|
897
|
-
}));
|
|
898
|
-
yield afterAuthNavigation();
|
|
899
|
-
}
|
|
900
|
-
} else {
|
|
901
|
-
onRedirectTo(routes.loginUrl, {
|
|
902
|
-
preserveQueryParams: true
|
|
903
|
-
});
|
|
904
|
-
}
|
|
905
|
-
localStorage.removeItem('register-quick-login');
|
|
906
|
-
callback == null ? void 0 : callback(true);
|
|
907
|
-
}
|
|
908
|
-
} catch (e) {
|
|
909
|
-
yield put(actions.setLoginState({
|
|
910
|
-
error: errorHandler(e, 'Failed to authenticate')
|
|
911
|
-
}));
|
|
912
|
-
} finally {
|
|
913
|
-
yield put(actions.setLoginState({
|
|
914
|
-
loading: false
|
|
915
|
-
}));
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
function* verifyInviteToken({
|
|
919
|
-
payload
|
|
920
|
-
}) {
|
|
921
|
-
try {
|
|
922
|
-
yield put(actions.setLoginState({
|
|
923
|
-
loading: true
|
|
924
|
-
}));
|
|
925
|
-
const {
|
|
926
|
-
name: inviteTokenTenantName
|
|
927
|
-
} = yield call(api.auth.verifyInviteToken, payload);
|
|
928
|
-
yield put(actions.setLoginState({
|
|
929
|
-
inviteTokenTenantName
|
|
930
|
-
}));
|
|
931
|
-
} catch (e) {
|
|
932
|
-
yield put(actions.setLoginState({
|
|
933
|
-
inviteTokenError: errorHandler(e, `We couldn't verify your invitation`)
|
|
934
|
-
}));
|
|
935
|
-
} finally {
|
|
936
|
-
yield put(actions.setLoginState({
|
|
937
|
-
loading: false
|
|
938
|
-
}));
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
function* preLogin({
|
|
942
|
-
payload: {
|
|
943
|
-
email,
|
|
944
|
-
recaptchaToken,
|
|
945
|
-
invitationToken,
|
|
946
|
-
callback
|
|
947
|
-
}
|
|
948
|
-
}) {
|
|
949
|
-
yield put(actions.setLoginState({
|
|
950
|
-
loading: true
|
|
951
|
-
}));
|
|
952
|
-
try {
|
|
953
|
-
const onRedirectTo = yield select(({
|
|
954
|
-
auth: {
|
|
955
|
-
onRedirectTo
|
|
956
|
-
}
|
|
957
|
-
}) => onRedirectTo);
|
|
958
|
-
const tenantId = getSearchParam(TENANT_ID_PARAM_KEY);
|
|
959
|
-
const {
|
|
960
|
-
address,
|
|
961
|
-
idpType
|
|
962
|
-
} = yield call(api.auth.preLoginV2, {
|
|
963
|
-
email,
|
|
964
|
-
tenantId
|
|
965
|
-
});
|
|
966
|
-
if (address) {
|
|
967
|
-
let ssoRedirectUrl = address;
|
|
968
|
-
if (idpType === SamlVendors.Oidc && !ssoRedirectUrl.includes('redirect_uri')) {
|
|
969
|
-
const {
|
|
970
|
-
routes: {
|
|
971
|
-
oidcRedirectUrl
|
|
972
|
-
}
|
|
973
|
-
} = yield select(({
|
|
974
|
-
auth: {
|
|
975
|
-
routes
|
|
976
|
-
}
|
|
977
|
-
}) => ({
|
|
978
|
-
routes
|
|
979
|
-
}));
|
|
980
|
-
ssoRedirectUrl += `&redirect_uri=${window.location.origin}${oidcRedirectUrl}`;
|
|
981
|
-
}
|
|
982
|
-
yield put(actions.setLoginState({
|
|
983
|
-
step: LoginStep.redirectToSSO,
|
|
984
|
-
loading: false,
|
|
985
|
-
ssoRedirectUrl
|
|
986
|
-
}));
|
|
987
|
-
setTimeout(() => {
|
|
988
|
-
onRedirectTo(ssoRedirectUrl, {
|
|
989
|
-
refresh: true
|
|
990
|
-
});
|
|
991
|
-
}, 2000);
|
|
992
|
-
} else {
|
|
993
|
-
yield ssoPreloginFailed({
|
|
994
|
-
email,
|
|
995
|
-
recaptchaToken,
|
|
996
|
-
callback,
|
|
997
|
-
invitationToken
|
|
998
|
-
});
|
|
999
|
-
}
|
|
1000
|
-
} catch (e) {
|
|
1001
|
-
yield ssoPreloginFailed({
|
|
1002
|
-
email,
|
|
1003
|
-
recaptchaToken,
|
|
1004
|
-
callback,
|
|
1005
|
-
invitationToken
|
|
1006
|
-
});
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
function* ssoPreloginFailed(_ref9) {
|
|
1010
|
-
let {
|
|
1011
|
-
callback
|
|
1012
|
-
} = _ref9,
|
|
1013
|
-
body = _objectWithoutPropertiesLoose(_ref9, _excluded6);
|
|
1014
|
-
const publicPolicy = yield select(({
|
|
1015
|
-
auth: {
|
|
1016
|
-
securityPolicyState: {
|
|
1017
|
-
publicPolicy: {
|
|
1018
|
-
policy: publicPolicy
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
}) => publicPolicy);
|
|
1023
|
-
if (!(publicPolicy != null && publicPolicy.authStrategy)) {
|
|
1024
|
-
yield put(actions.setLoginState({
|
|
1025
|
-
step: LoginStep.loginWithPassword,
|
|
1026
|
-
loading: false
|
|
1027
|
-
}));
|
|
1028
|
-
callback == null ? void 0 : callback();
|
|
1029
|
-
return;
|
|
1030
|
-
}
|
|
1031
|
-
if ((publicPolicy == null ? void 0 : publicPolicy.authStrategy) === AuthStrategyEnum.EmailAndPassword) {
|
|
1032
|
-
yield put(actions.setLoginState({
|
|
1033
|
-
step: LoginStep.loginWithPassword,
|
|
1034
|
-
loading: false
|
|
1035
|
-
}));
|
|
1036
|
-
callback == null ? void 0 : callback();
|
|
1037
|
-
} else if ([AuthStrategyEnum.MagicLink, AuthStrategyEnum.Code, AuthStrategyEnum.SmsCode].includes(publicPolicy == null ? void 0 : publicPolicy.authStrategy)) {
|
|
1038
|
-
yield put(actions.passwordlessPreLogin(_extends({}, body, {
|
|
1039
|
-
type: publicPolicy == null ? void 0 : publicPolicy.authStrategy,
|
|
1040
|
-
callback
|
|
1041
|
-
})));
|
|
1042
|
-
} else {
|
|
1043
|
-
yield put(actions.setLoginState({
|
|
1044
|
-
step: LoginStep.loginWithPassword,
|
|
1045
|
-
loading: false
|
|
1046
|
-
}));
|
|
1047
|
-
callback == null ? void 0 : callback();
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
function* webAuthnCreateNewDeviceSession({
|
|
1051
|
-
payload: {
|
|
1052
|
-
callback
|
|
1053
|
-
}
|
|
1054
|
-
}) {
|
|
1055
|
-
try {
|
|
1056
|
-
yield put(actions.setLoginState({
|
|
1057
|
-
loading: true
|
|
1058
|
-
}));
|
|
1059
|
-
const {
|
|
1060
|
-
options
|
|
1061
|
-
} = yield call(api.auth.webAuthnCreateNewDeviceSession);
|
|
1062
|
-
options.user.id = base64urlDecode(options.user.id);
|
|
1063
|
-
options.challenge = base64urlDecode(options.challenge);
|
|
1064
|
-
options.excludeCredentials = [];
|
|
1065
|
-
callback == null ? void 0 : callback(options);
|
|
1066
|
-
} catch (e) {
|
|
1067
|
-
yield put(actions.setLoginState({
|
|
1068
|
-
error: errorHandler(e)
|
|
1069
|
-
}));
|
|
1070
|
-
callback == null ? void 0 : callback(null);
|
|
1071
|
-
} finally {
|
|
1072
|
-
yield put(actions.setLoginState({
|
|
1073
|
-
loading: false
|
|
1074
|
-
}));
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1077
|
-
function* webAuthnVerifyNewDeviceSession(_ref10) {
|
|
1078
|
-
let {
|
|
1079
|
-
payload: {
|
|
1080
|
-
callback
|
|
1081
|
-
}
|
|
1082
|
-
} = _ref10,
|
|
1083
|
-
body = _objectWithoutPropertiesLoose(_ref10.payload, _excluded7);
|
|
1084
|
-
try {
|
|
1085
|
-
yield put(actions.setLoginState({
|
|
1086
|
-
loading: true
|
|
1087
|
-
}));
|
|
1088
|
-
const publicKey = publicKeyCredentialToJSON(body.publicKey);
|
|
1089
|
-
const deviceType = (publicKey == null ? void 0 : publicKey.authenticatorAttachment) === 'platform' ? WebAuthnDeviceType.Platform : WebAuthnDeviceType.CrossPlatform;
|
|
1090
|
-
yield call(api.auth.verifyNewDeviceSession, {
|
|
1091
|
-
id: publicKey.id,
|
|
1092
|
-
response: publicKey.response,
|
|
1093
|
-
deviceType: deviceType
|
|
1094
|
-
});
|
|
1095
|
-
callback == null ? void 0 : callback(true);
|
|
1096
|
-
} catch (e) {
|
|
1097
|
-
yield put(actions.setLoginState({
|
|
1098
|
-
error: errorHandler(e)
|
|
1099
|
-
}));
|
|
1100
|
-
callback == null ? void 0 : callback(null);
|
|
1101
|
-
} finally {
|
|
1102
|
-
yield put(actions.setLoginState({
|
|
1103
|
-
loading: false
|
|
1104
|
-
}));
|
|
1105
|
-
}
|
|
1106
|
-
}
|
|
1107
|
-
function* webAuthnPrelogin(_ref11) {
|
|
1108
|
-
let {
|
|
1109
|
-
payload: {
|
|
1110
|
-
callback
|
|
1111
|
-
}
|
|
1112
|
-
} = _ref11,
|
|
1113
|
-
body = _objectWithoutPropertiesLoose(_ref11.payload, _excluded8);
|
|
1114
|
-
try {
|
|
1115
|
-
var _options$allowCredent;
|
|
1116
|
-
yield put(actions.setPasskeysState({
|
|
1117
|
-
loading: true
|
|
1118
|
-
}));
|
|
1119
|
-
yield put(actions.setLoginState({
|
|
1120
|
-
loading: true
|
|
1121
|
-
}));
|
|
1122
|
-
const {
|
|
1123
|
-
options
|
|
1124
|
-
} = yield call(api.auth.webAuthnPreLogin, body);
|
|
1125
|
-
options.challenge = base64urlDecode(options.challenge);
|
|
1126
|
-
options.allowCredentials = (_options$allowCredent = options.allowCredentials) == null ? void 0 : _options$allowCredent.map(credentials => _extends({}, credentials, {
|
|
1127
|
-
id: base64urlDecode(credentials.id)
|
|
1128
|
-
}));
|
|
1129
|
-
yield put(actions.setLoginState({
|
|
1130
|
-
error: undefined
|
|
1131
|
-
}));
|
|
1132
|
-
callback == null ? void 0 : callback(options);
|
|
1133
|
-
} catch (e) {
|
|
1134
|
-
yield put(actions.setLoginState({
|
|
1135
|
-
error: errorHandler(e)
|
|
1136
|
-
}));
|
|
1137
|
-
callback == null ? void 0 : callback(null);
|
|
1138
|
-
} finally {
|
|
1139
|
-
yield put(actions.setPasskeysState({
|
|
1140
|
-
loading: false
|
|
1141
|
-
}));
|
|
1142
|
-
yield put(actions.setLoginState({
|
|
1143
|
-
loading: false
|
|
1144
|
-
}));
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
function* webAuthnPostLogin(_ref12) {
|
|
1148
|
-
let {
|
|
1149
|
-
payload: {
|
|
1150
|
-
callback
|
|
1151
|
-
}
|
|
1152
|
-
} = _ref12,
|
|
1153
|
-
body = _objectWithoutPropertiesLoose(_ref12.payload, _excluded9);
|
|
1154
|
-
try {
|
|
1155
|
-
var _publicKey$response$u;
|
|
1156
|
-
yield put(actions.setPasskeysState({
|
|
1157
|
-
loading: true
|
|
1158
|
-
}));
|
|
1159
|
-
yield put(actions.setLoginState({
|
|
1160
|
-
loading: true
|
|
1161
|
-
}));
|
|
1162
|
-
const publicKey = publicKeyCredentialToJSON(body.publicKey);
|
|
1163
|
-
const _yield$call = yield call(api.auth.webAuthnPostLoginV2, _extends({}, publicKey, {
|
|
1164
|
-
response: _extends({}, publicKey.response, {
|
|
1165
|
-
userHandle: (_publicKey$response$u = publicKey.response.userHandle) != null ? _publicKey$response$u : undefined
|
|
1166
|
-
}),
|
|
1167
|
-
recaptchaToken: body.recaptchaToken,
|
|
1168
|
-
invitationToken: body.invitationToken
|
|
1169
|
-
})),
|
|
1170
|
-
{
|
|
1171
|
-
user
|
|
1172
|
-
} = _yield$call,
|
|
1173
|
-
rest = _objectWithoutPropertiesLoose(_yield$call, _excluded10);
|
|
1174
|
-
if (isMfaRequired(user)) {
|
|
1175
|
-
const onRedirectTo = ContextHolder.onRedirectTo;
|
|
1176
|
-
const {
|
|
1177
|
-
routes
|
|
1178
|
-
} = yield select(state => state.auth);
|
|
1179
|
-
const mfaRequiredState = yield getMfaRequiredState(user);
|
|
1180
|
-
yield put(actions.setState(mfaRequiredState));
|
|
1181
|
-
onRedirectTo(routes.loginUrl, {
|
|
1182
|
-
preserveQueryParams: true
|
|
1183
|
-
});
|
|
1184
|
-
} else {
|
|
1185
|
-
if (user.id) {
|
|
1186
|
-
localStorage.setItem('userId', user.id);
|
|
1187
|
-
}
|
|
1188
|
-
yield call(afterAuthenticationStateUpdate, _extends({
|
|
1189
|
-
user
|
|
1190
|
-
}, rest), {
|
|
1191
|
-
isAuthenticated: true
|
|
1192
|
-
});
|
|
1193
|
-
yield put(actions.setLoginState({
|
|
1194
|
-
error: undefined
|
|
1195
|
-
}));
|
|
1196
|
-
yield afterAuthNavigation();
|
|
1197
|
-
// TODO: Itamar why moving callback to inside the else block
|
|
1198
|
-
callback == null ? void 0 : callback(true);
|
|
1199
|
-
}
|
|
1200
|
-
// callback?.(true);
|
|
1201
|
-
} catch (e) {
|
|
1202
|
-
yield put(actions.setLoginState({
|
|
1203
|
-
error: errorHandler(e)
|
|
1204
|
-
}));
|
|
1205
|
-
callback == null ? void 0 : callback(null);
|
|
1206
|
-
} finally {
|
|
1207
|
-
yield put(actions.setPasskeysState({
|
|
1208
|
-
loading: false
|
|
1209
|
-
}));
|
|
1210
|
-
yield put(actions.setLoginState({
|
|
1211
|
-
loading: false
|
|
1212
|
-
}));
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
|
-
function* postLogin({
|
|
1216
|
-
payload
|
|
1217
|
-
}) {
|
|
1218
|
-
const {
|
|
1219
|
-
onRedirectTo,
|
|
1220
|
-
routes
|
|
1221
|
-
} = yield select(({
|
|
1222
|
-
auth: {
|
|
1223
|
-
onRedirectTo,
|
|
1224
|
-
routes
|
|
1225
|
-
}
|
|
1226
|
-
}) => ({
|
|
1227
|
-
onRedirectTo,
|
|
1228
|
-
routes
|
|
1229
|
-
}));
|
|
1230
|
-
yield put(actions.setLoginState({
|
|
1231
|
-
loading: true
|
|
1232
|
-
}));
|
|
1233
|
-
try {
|
|
1234
|
-
const user = yield call(api.auth.postLogin, payload);
|
|
1235
|
-
yield put(actions.setState({
|
|
1236
|
-
user: !!user.accessToken ? user : undefined,
|
|
1237
|
-
isAuthenticated: !!user.accessToken
|
|
1238
|
-
}));
|
|
1239
|
-
yield afterAuthNavigation();
|
|
1240
|
-
} catch (e) {
|
|
1241
|
-
setTimeout(() => {
|
|
1242
|
-
onRedirectTo(routes.authenticatedUrl);
|
|
1243
|
-
}, 1000);
|
|
1244
|
-
yield put(actions.setLoginState({
|
|
1245
|
-
step: LoginStep.loginWithSSOFailed,
|
|
1246
|
-
loading: false
|
|
1247
|
-
}));
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
|
-
function* login({
|
|
1251
|
-
payload: {
|
|
1252
|
-
email,
|
|
1253
|
-
password,
|
|
1254
|
-
recaptchaToken,
|
|
1255
|
-
invitationToken,
|
|
1256
|
-
callback
|
|
1257
|
-
}
|
|
1258
|
-
}) {
|
|
1259
|
-
yield put(actions.setLoginState({
|
|
1260
|
-
loading: true
|
|
1261
|
-
}));
|
|
1262
|
-
try {
|
|
1263
|
-
const {
|
|
1264
|
-
user,
|
|
1265
|
-
tenants = [],
|
|
1266
|
-
activeTenant
|
|
1267
|
-
} = yield call(api.auth.loginv2, {
|
|
1268
|
-
email,
|
|
1269
|
-
password,
|
|
1270
|
-
recaptchaToken,
|
|
1271
|
-
invitationToken
|
|
1272
|
-
});
|
|
1273
|
-
const onRedirectTo = ContextHolder.onRedirectTo;
|
|
1274
|
-
const {
|
|
1275
|
-
routes
|
|
1276
|
-
} = yield select(state => state.auth);
|
|
1277
|
-
if (isMfaRequired(user)) {
|
|
1278
|
-
const mfaRequiredState = yield getMfaRequiredState(user);
|
|
1279
|
-
yield put(actions.setState(mfaRequiredState));
|
|
1280
|
-
onRedirectTo(routes.loginUrl, {
|
|
1281
|
-
preserveQueryParams: true
|
|
1282
|
-
});
|
|
1283
|
-
} else {
|
|
1284
|
-
const {
|
|
1285
|
-
loginState
|
|
1286
|
-
} = yield select(state => state.auth);
|
|
1287
|
-
const isAuthenticated = !!user.accessToken;
|
|
1288
|
-
if (user.id) {
|
|
1289
|
-
localStorage.setItem('userId', user.id);
|
|
1290
|
-
}
|
|
1291
|
-
yield call(afterAuthenticationStateUpdate, {
|
|
1292
|
-
user,
|
|
1293
|
-
tenants,
|
|
1294
|
-
activeTenant
|
|
1295
|
-
}, {
|
|
1296
|
-
loginState: {
|
|
1297
|
-
flow: loginState.flow,
|
|
1298
|
-
quickLoginToRegister: loginState.quickLoginToRegister,
|
|
1299
|
-
email,
|
|
1300
|
-
loading: false,
|
|
1301
|
-
error: undefined,
|
|
1302
|
-
mfaToken: user.mfaToken,
|
|
1303
|
-
step: loginState.flow === LoginFlow.Login ? LoginStep.success : loginState.step,
|
|
1304
|
-
tenants,
|
|
1305
|
-
tenantsLoading: true,
|
|
1306
|
-
isBreachedPassword: user.isBreachedPassword
|
|
1307
|
-
},
|
|
1308
|
-
isAuthenticated
|
|
1309
|
-
});
|
|
1310
|
-
const [securityCenterLoginFlows] = yield call(getFeatureFlags, ['security-center-show-login-flows']);
|
|
1311
|
-
if (loginState.flow === LoginFlow.Login) {
|
|
1312
|
-
if (securityCenterLoginFlows && user.isBreachedPassword) {
|
|
1313
|
-
yield put(actions.setLoginState({
|
|
1314
|
-
step: LoginStep.breachedPassword,
|
|
1315
|
-
loading: false
|
|
1316
|
-
}));
|
|
1317
|
-
} else {
|
|
1318
|
-
if (isAuthenticated) {
|
|
1319
|
-
const shouldShowPrompt = yield call(shouldShowPromptPasskeys);
|
|
1320
|
-
if (shouldShowPrompt) {
|
|
1321
|
-
yield put(actions.setLoginState({
|
|
1322
|
-
step: LoginStep.promptPasskeys,
|
|
1323
|
-
loading: false
|
|
1324
|
-
}));
|
|
1325
|
-
onRedirectTo(routes.loginUrl, {
|
|
1326
|
-
preserveQueryParams: true
|
|
1327
|
-
});
|
|
1328
|
-
} else {
|
|
1329
|
-
yield afterAuthNavigation();
|
|
1330
|
-
}
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
// TODO: extract item name to constants
|
|
1337
|
-
localStorage.removeItem('register-quick-login');
|
|
1338
|
-
callback == null ? void 0 : callback(true);
|
|
1339
|
-
} catch (e) {
|
|
1340
|
-
ContextHolder.setAccessToken(null);
|
|
1341
|
-
ContextHolder.setUser(null);
|
|
1342
|
-
callback == null ? void 0 : callback(false, e);
|
|
1343
|
-
yield put(actions.setLoginState({
|
|
1344
|
-
email,
|
|
1345
|
-
error: errorHandler(e),
|
|
1346
|
-
loading: false
|
|
1347
|
-
}));
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
function* loginWithMfa({
|
|
1351
|
-
payload: {
|
|
1352
|
-
mfaToken,
|
|
1353
|
-
value,
|
|
1354
|
-
rememberDevice,
|
|
1355
|
-
callback
|
|
1356
|
-
}
|
|
1357
|
-
}) {
|
|
1358
|
-
yield put(actions.setLoginState({
|
|
1359
|
-
loading: true
|
|
1360
|
-
}));
|
|
1361
|
-
try {
|
|
1362
|
-
const {
|
|
1363
|
-
user,
|
|
1364
|
-
tenants = [],
|
|
1365
|
-
activeTenant
|
|
1366
|
-
} = yield call(api.auth.loginWithMfaV2, {
|
|
1367
|
-
mfaToken,
|
|
1368
|
-
value,
|
|
1369
|
-
rememberDevice
|
|
1370
|
-
});
|
|
1371
|
-
const {
|
|
1372
|
-
loginState
|
|
1373
|
-
} = yield select(state => state.auth);
|
|
1374
|
-
const step = loginState.flow === LoginFlow.Login ? LoginStep.success : loginState.step;
|
|
1375
|
-
const isAuthenticated = !!user.accessToken;
|
|
1376
|
-
yield call(afterAuthenticationStateUpdate, {
|
|
1377
|
-
user,
|
|
1378
|
-
tenants,
|
|
1379
|
-
activeTenant
|
|
1380
|
-
}, {
|
|
1381
|
-
loginState: {
|
|
1382
|
-
flow: loginState.flow,
|
|
1383
|
-
quickLoginToRegister: loginState.quickLoginToRegister,
|
|
1384
|
-
loading: false,
|
|
1385
|
-
step,
|
|
1386
|
-
error: undefined,
|
|
1387
|
-
tenants
|
|
1388
|
-
},
|
|
1389
|
-
isAuthenticated
|
|
1390
|
-
});
|
|
1391
|
-
if (user.id) {
|
|
1392
|
-
localStorage.setItem('userId', user.id);
|
|
1393
|
-
}
|
|
1394
|
-
yield put(actions.setLoginState({
|
|
1395
|
-
error: undefined,
|
|
1396
|
-
loading: false
|
|
1397
|
-
}));
|
|
1398
|
-
const [securityCenterLoginFlows] = yield call(getFeatureFlags, ['security-center-show-login-flows']);
|
|
1399
|
-
if (loginState.flow === LoginFlow.Login) {
|
|
1400
|
-
if (securityCenterLoginFlows && loginState.isBreachedPassword) {
|
|
1401
|
-
yield put(actions.setLoginState({
|
|
1402
|
-
step: LoginStep.breachedPassword,
|
|
1403
|
-
loading: false
|
|
1404
|
-
}));
|
|
1405
|
-
} else {
|
|
1406
|
-
const shouldShowPrompt = yield call(shouldShowPromptPasskeys);
|
|
1407
|
-
if (shouldShowPrompt) {
|
|
1408
|
-
yield put(actions.setLoginState({
|
|
1409
|
-
step: LoginStep.promptPasskeys,
|
|
1410
|
-
loading: false
|
|
1411
|
-
}));
|
|
1412
|
-
} else {
|
|
1413
|
-
yield afterAuthNavigation();
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
callback == null ? void 0 : callback(true);
|
|
1418
|
-
} catch (e) {
|
|
1419
|
-
yield put(actions.setLoginState({
|
|
1420
|
-
error: errorHandler(e),
|
|
1421
|
-
loading: false
|
|
1422
|
-
}));
|
|
1423
|
-
callback == null ? void 0 : callback(false, e);
|
|
1424
|
-
}
|
|
1425
|
-
}
|
|
1426
|
-
function* recoverMfa({
|
|
1427
|
-
payload
|
|
1428
|
-
}) {
|
|
1429
|
-
yield put(actions.setLoginState({
|
|
1430
|
-
loading: true
|
|
1431
|
-
}));
|
|
1432
|
-
try {
|
|
1433
|
-
var _payload$callback;
|
|
1434
|
-
yield call(api.auth.recoverMfaToken, payload);
|
|
1435
|
-
yield put(actions.setLoginState({
|
|
1436
|
-
loading: false,
|
|
1437
|
-
error: undefined,
|
|
1438
|
-
step: LoginStep.preLogin
|
|
1439
|
-
}));
|
|
1440
|
-
yield put(actions.setState({
|
|
1441
|
-
user: undefined,
|
|
1442
|
-
isAuthenticated: false
|
|
1443
|
-
}));
|
|
1444
|
-
(_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, true);
|
|
1445
|
-
} catch (e) {
|
|
1446
|
-
var _payload$callback2;
|
|
1447
|
-
yield put(actions.setLoginState({
|
|
1448
|
-
error: errorHandler(e),
|
|
1449
|
-
loading: false
|
|
1450
|
-
}));
|
|
1451
|
-
(_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, false, e);
|
|
1452
|
-
}
|
|
1453
|
-
}
|
|
1454
|
-
function* logout({
|
|
1455
|
-
payload
|
|
1456
|
-
}) {
|
|
1457
|
-
const {
|
|
1458
|
-
hostedLoginBox
|
|
1459
|
-
} = yield select(state => state.auth);
|
|
1460
|
-
yield put(actions.setState({
|
|
1461
|
-
isLoading: true
|
|
1462
|
-
}));
|
|
1463
|
-
try {
|
|
1464
|
-
if (hostedLoginBox) {
|
|
1465
|
-
yield call(api.auth.OAuthLogout);
|
|
1466
|
-
} else {
|
|
1467
|
-
yield call(api.auth.logout);
|
|
1468
|
-
}
|
|
1469
|
-
} catch {}
|
|
1470
|
-
yield put(actions.resetState());
|
|
1471
|
-
yield put(actions.requestAuthorize(true));
|
|
1472
|
-
payload == null ? void 0 : payload();
|
|
1473
|
-
}
|
|
1474
|
-
function* silentLogout({
|
|
1475
|
-
payload
|
|
1476
|
-
}) {
|
|
1477
|
-
var _payload$callbackTime;
|
|
1478
|
-
try {
|
|
1479
|
-
yield call(api.auth.logout);
|
|
1480
|
-
} catch {}
|
|
1481
|
-
setTimeout(() => {
|
|
1482
|
-
var _payload$callback3;
|
|
1483
|
-
return payload == null ? void 0 : (_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, true);
|
|
1484
|
-
}, (_payload$callbackTime = payload == null ? void 0 : payload.callbackTimeout) != null ? _payload$callbackTime : 500);
|
|
1485
|
-
}
|
|
1486
|
-
function* handleEnrollMFAResponse({
|
|
1487
|
-
user,
|
|
1488
|
-
tenants,
|
|
1489
|
-
activeTenant
|
|
1490
|
-
}) {
|
|
1491
|
-
const mfaState = {
|
|
1492
|
-
step: MFAStep.recoveryCode,
|
|
1493
|
-
loading: false,
|
|
1494
|
-
error: undefined,
|
|
1495
|
-
saving: false
|
|
1496
|
-
};
|
|
1497
|
-
if (user != null && user.recoveryCode) {
|
|
1498
|
-
mfaState.recoveryCode = user.recoveryCode;
|
|
1499
|
-
}
|
|
1500
|
-
yield put(actions.setMfaState(mfaState));
|
|
1501
|
-
yield put(actions.setUser(user));
|
|
1502
|
-
yield put(actions.setTenantsState({
|
|
1503
|
-
tenants,
|
|
1504
|
-
activeTenant,
|
|
1505
|
-
loading: false
|
|
1506
|
-
}));
|
|
1507
|
-
if (user.id) {
|
|
1508
|
-
localStorage.setItem('userId', user.id);
|
|
1509
|
-
}
|
|
1510
|
-
}
|
|
1511
|
-
function* handleVerifyMFAResponse({
|
|
1512
|
-
user,
|
|
1513
|
-
tenants,
|
|
1514
|
-
activeTenant
|
|
1515
|
-
}) {
|
|
1516
|
-
const {
|
|
1517
|
-
loginState
|
|
1518
|
-
} = yield select(state => state.auth);
|
|
1519
|
-
yield put(actions.setUser(user));
|
|
1520
|
-
yield put(actions.setTenantsState({
|
|
1521
|
-
tenants,
|
|
1522
|
-
activeTenant,
|
|
1523
|
-
loading: false
|
|
1524
|
-
}));
|
|
1525
|
-
if (user.id) {
|
|
1526
|
-
localStorage.setItem('userId', user.id);
|
|
1527
|
-
}
|
|
1528
|
-
const {
|
|
1529
|
-
step: mfaStep
|
|
1530
|
-
} = yield select(state => state.auth.mfaState);
|
|
1531
|
-
const [securityCenterLoginFlows] = yield call(getFeatureFlags, ['security-center-show-login-flows']);
|
|
1532
|
-
if (loginState.flow === LoginFlow.Login) {
|
|
1533
|
-
if (securityCenterLoginFlows && loginState.isBreachedPassword) {
|
|
1534
|
-
yield put(actions.setLoginState({
|
|
1535
|
-
step: LoginStep.breachedPassword,
|
|
1536
|
-
loading: false
|
|
1537
|
-
}));
|
|
1538
|
-
} else {
|
|
1539
|
-
const shouldShowPrompt = yield call(shouldShowPromptPasskeys);
|
|
1540
|
-
if (mfaStep === MFAStep.smsVerifyCode && shouldShowPrompt) {
|
|
1541
|
-
yield put(actions.setLoginState({
|
|
1542
|
-
step: LoginStep.promptPasskeys,
|
|
1543
|
-
loading: false
|
|
1544
|
-
}));
|
|
1545
|
-
} else {
|
|
1546
|
-
yield afterAuthNavigation();
|
|
1547
|
-
}
|
|
1548
|
-
}
|
|
1549
|
-
}
|
|
1550
|
-
yield put(actions.setState({
|
|
1551
|
-
isAuthenticated: !!user.accessToken
|
|
1552
|
-
}));
|
|
1553
|
-
}
|
|
1554
|
-
function* preEnrollMFASMSForLogin(_ref13) {
|
|
1555
|
-
let {
|
|
1556
|
-
payload: {
|
|
1557
|
-
callback
|
|
1558
|
-
}
|
|
1559
|
-
} = _ref13,
|
|
1560
|
-
payload = _objectWithoutPropertiesLoose(_ref13.payload, _excluded11);
|
|
1561
|
-
yield put(actions.setLoginState({
|
|
1562
|
-
loading: true
|
|
1563
|
-
}));
|
|
1564
|
-
try {
|
|
1565
|
-
const data = yield call(api.auth.preEnrollMFASMSForLogin, payload);
|
|
1566
|
-
yield put(actions.setMfaState({
|
|
1567
|
-
otcToken: data.otcToken,
|
|
1568
|
-
step: MFAStep.smsVerifyCode,
|
|
1569
|
-
phoneNumber: data.phoneNumber
|
|
1570
|
-
}));
|
|
1571
|
-
yield put(actions.setLoginState({
|
|
1572
|
-
loading: false
|
|
1573
|
-
}));
|
|
1574
|
-
callback == null ? void 0 : callback(true);
|
|
1575
|
-
} catch (e) {
|
|
1576
|
-
yield put(actions.setLoginState({
|
|
1577
|
-
loading: false,
|
|
1578
|
-
error: errorHandler(e)
|
|
1579
|
-
}));
|
|
1580
|
-
callback == null ? void 0 : callback(null);
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
function* enrollMFASMSForLogin(_ref14) {
|
|
1584
|
-
let {
|
|
1585
|
-
payload: {
|
|
1586
|
-
callback
|
|
1587
|
-
}
|
|
1588
|
-
} = _ref14,
|
|
1589
|
-
payload = _objectWithoutPropertiesLoose(_ref14.payload, _excluded12);
|
|
1590
|
-
yield put(actions.setLoginState({
|
|
1591
|
-
loading: true
|
|
1592
|
-
}));
|
|
1593
|
-
try {
|
|
1594
|
-
const data = yield call(api.auth.enrollMFASMSForLoginV2, payload);
|
|
1595
|
-
yield handleEnrollMFAResponse(data);
|
|
1596
|
-
yield put(actions.setLoginState({
|
|
1597
|
-
loading: false
|
|
1598
|
-
}));
|
|
1599
|
-
callback == null ? void 0 : callback(true);
|
|
1600
|
-
} catch (e) {
|
|
1601
|
-
yield put(actions.setLoginState({
|
|
1602
|
-
loading: false,
|
|
1603
|
-
error: errorHandler(e)
|
|
1604
|
-
}));
|
|
1605
|
-
callback == null ? void 0 : callback(null);
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
|
-
function* preEnrollMFAWebAuthnForLogin(_ref15) {
|
|
1609
|
-
let {
|
|
1610
|
-
payload: {
|
|
1611
|
-
callback
|
|
1612
|
-
}
|
|
1613
|
-
} = _ref15,
|
|
1614
|
-
payload = _objectWithoutPropertiesLoose(_ref15.payload, _excluded13);
|
|
1615
|
-
yield put(actions.setLoginState({
|
|
1616
|
-
loading: true
|
|
1617
|
-
}));
|
|
1618
|
-
try {
|
|
1619
|
-
var _data$options$exclude;
|
|
1620
|
-
const data = yield call(api.auth.preEnrollMFAWebAuthnForLogin, payload);
|
|
1621
|
-
const options = _extends({}, data.options, {
|
|
1622
|
-
challenge: base64urlDecode(data.options.challenge),
|
|
1623
|
-
user: _extends({}, data.options.user, {
|
|
1624
|
-
id: base64urlDecode(data.options.user.id)
|
|
1625
|
-
}),
|
|
1626
|
-
excludeCredentials: (_data$options$exclude = data.options.excludeCredentials) == null ? void 0 : _data$options$exclude.map(credentials => _extends({}, credentials, {
|
|
1627
|
-
id: base64urlDecode(credentials.id)
|
|
1628
|
-
}))
|
|
1629
|
-
});
|
|
1630
|
-
yield put(actions.setLoginState({
|
|
1631
|
-
loading: false
|
|
1632
|
-
}));
|
|
1633
|
-
callback == null ? void 0 : callback({
|
|
1634
|
-
options,
|
|
1635
|
-
webauthnToken: data.webauthnToken
|
|
1636
|
-
});
|
|
1637
|
-
} catch (e) {
|
|
1638
|
-
yield put(actions.setLoginState({
|
|
1639
|
-
loading: false,
|
|
1640
|
-
error: errorHandler(e)
|
|
1641
|
-
}));
|
|
1642
|
-
callback == null ? void 0 : callback(null);
|
|
1643
|
-
}
|
|
1644
|
-
}
|
|
1645
|
-
function* enrollMFAWebAuthnForLogin(_ref16) {
|
|
1646
|
-
let {
|
|
1647
|
-
payload: {
|
|
1648
|
-
callback
|
|
1649
|
-
}
|
|
1650
|
-
} = _ref16,
|
|
1651
|
-
payload = _objectWithoutPropertiesLoose(_ref16.payload, _excluded14);
|
|
1652
|
-
yield put(actions.setLoginState({
|
|
1653
|
-
loading: true
|
|
1654
|
-
}));
|
|
1655
|
-
try {
|
|
1656
|
-
const publicKey = publicKeyCredentialToJSON(payload.publicKey);
|
|
1657
|
-
const data = yield call(api.auth.enrollMFAWebAuthnForLoginV2, _extends({}, payload, {
|
|
1658
|
-
options: publicKey
|
|
1659
|
-
}));
|
|
1660
|
-
yield handleEnrollMFAResponse(data);
|
|
1661
|
-
yield put(actions.setLoginState({
|
|
1662
|
-
loading: false
|
|
1663
|
-
}));
|
|
1664
|
-
callback == null ? void 0 : callback(true);
|
|
1665
|
-
} catch (e) {
|
|
1666
|
-
yield put(actions.setLoginState({
|
|
1667
|
-
loading: false,
|
|
1668
|
-
error: errorHandler(e)
|
|
1669
|
-
}));
|
|
1670
|
-
callback == null ? void 0 : callback(null);
|
|
1671
|
-
}
|
|
1672
|
-
}
|
|
1673
|
-
function* enrollMFAAuthenticatorAppForLogin(_ref17) {
|
|
1674
|
-
let {
|
|
1675
|
-
payload: {
|
|
1676
|
-
callback
|
|
1677
|
-
}
|
|
1678
|
-
} = _ref17,
|
|
1679
|
-
payload = _objectWithoutPropertiesLoose(_ref17.payload, _excluded15);
|
|
1680
|
-
yield put(actions.setLoginState({
|
|
1681
|
-
loading: true
|
|
1682
|
-
}));
|
|
1683
|
-
try {
|
|
1684
|
-
const data = yield call(api.auth.enrollMFAAuthenticatorAppForLoginV2, payload);
|
|
1685
|
-
yield handleEnrollMFAResponse(data);
|
|
1686
|
-
yield put(actions.setLoginState({
|
|
1687
|
-
loading: false
|
|
1688
|
-
}));
|
|
1689
|
-
callback == null ? void 0 : callback(true);
|
|
1690
|
-
} catch (e) {
|
|
1691
|
-
yield put(actions.setLoginState({
|
|
1692
|
-
loading: false,
|
|
1693
|
-
error: errorHandler(e)
|
|
1694
|
-
}));
|
|
1695
|
-
callback == null ? void 0 : callback(null);
|
|
1696
|
-
}
|
|
1697
|
-
}
|
|
1698
|
-
function* preVerifyMFASMSForLogin(_ref18) {
|
|
1699
|
-
let {
|
|
1700
|
-
payload: {
|
|
1701
|
-
callback,
|
|
1702
|
-
deviceId
|
|
1703
|
-
}
|
|
1704
|
-
} = _ref18,
|
|
1705
|
-
payload = _objectWithoutPropertiesLoose(_ref18.payload, _excluded16);
|
|
1706
|
-
yield put(actions.setLoginState({
|
|
1707
|
-
loading: true
|
|
1708
|
-
}));
|
|
1709
|
-
try {
|
|
1710
|
-
const data = yield call(api.auth.preVerifyMFASMSForLogin, deviceId, payload);
|
|
1711
|
-
yield put(actions.setMfaState({
|
|
1712
|
-
otcToken: data.otcToken,
|
|
1713
|
-
step: MFAStep.smsVerifyCode,
|
|
1714
|
-
phoneNumber: data.phoneNumber
|
|
1715
|
-
}));
|
|
1716
|
-
yield put(actions.setLoginState({
|
|
1717
|
-
loading: false
|
|
1718
|
-
}));
|
|
1719
|
-
callback == null ? void 0 : callback(true);
|
|
1720
|
-
} catch (e) {
|
|
1721
|
-
yield put(actions.setLoginState({
|
|
1722
|
-
loading: false,
|
|
1723
|
-
error: errorHandler(e)
|
|
1724
|
-
}));
|
|
1725
|
-
callback == null ? void 0 : callback(null);
|
|
1726
|
-
}
|
|
1727
|
-
}
|
|
1728
|
-
function* preVerifyMFAEmailCode(_ref19) {
|
|
1729
|
-
let {
|
|
1730
|
-
payload: {
|
|
1731
|
-
callback
|
|
1732
|
-
}
|
|
1733
|
-
} = _ref19,
|
|
1734
|
-
payload = _objectWithoutPropertiesLoose(_ref19.payload, _excluded17);
|
|
1735
|
-
try {
|
|
1736
|
-
const data = yield call(api.auth.preVerifyMFAEmailCode, payload);
|
|
1737
|
-
yield put(actions.setMfaState({
|
|
1738
|
-
otcToken: data.otcToken,
|
|
1739
|
-
step: MFAStep.emailVerifyCode
|
|
1740
|
-
}));
|
|
1741
|
-
callback == null ? void 0 : callback(true);
|
|
1742
|
-
} catch (e) {
|
|
1743
|
-
yield put(actions.setLoginState({
|
|
1744
|
-
error: errorHandler(e)
|
|
1745
|
-
}));
|
|
1746
|
-
callback == null ? void 0 : callback(null);
|
|
1747
|
-
}
|
|
1748
|
-
}
|
|
1749
|
-
function* verifyMFAEmailCode(_ref20) {
|
|
1750
|
-
let {
|
|
1751
|
-
payload: {
|
|
1752
|
-
callback
|
|
1753
|
-
}
|
|
1754
|
-
} = _ref20,
|
|
1755
|
-
payload = _objectWithoutPropertiesLoose(_ref20.payload, _excluded18);
|
|
1756
|
-
yield put(actions.setLoginState({
|
|
1757
|
-
loading: true
|
|
1758
|
-
}));
|
|
1759
|
-
try {
|
|
1760
|
-
const data = yield call(api.auth.verifyMFAEmailCodeV2, payload);
|
|
1761
|
-
yield handleVerifyMFAResponse(data);
|
|
1762
|
-
yield put(actions.setLoginState({
|
|
1763
|
-
loading: false
|
|
1764
|
-
}));
|
|
1765
|
-
callback == null ? void 0 : callback(true);
|
|
1766
|
-
} catch (e) {
|
|
1767
|
-
yield put(actions.setLoginState({
|
|
1768
|
-
loading: false,
|
|
1769
|
-
error: errorHandler(e)
|
|
1770
|
-
}));
|
|
1771
|
-
callback == null ? void 0 : callback(null);
|
|
1772
|
-
}
|
|
1773
|
-
}
|
|
1774
|
-
function* verifyMFASMSForLogin(_ref21) {
|
|
1775
|
-
let {
|
|
1776
|
-
payload: {
|
|
1777
|
-
callback,
|
|
1778
|
-
deviceId
|
|
1779
|
-
}
|
|
1780
|
-
} = _ref21,
|
|
1781
|
-
payload = _objectWithoutPropertiesLoose(_ref21.payload, _excluded19);
|
|
1782
|
-
yield put(actions.setLoginState({
|
|
1783
|
-
loading: true
|
|
1784
|
-
}));
|
|
1785
|
-
try {
|
|
1786
|
-
const data = yield call(api.auth.verifyMFASMSForLoginV2, deviceId, payload);
|
|
1787
|
-
yield handleVerifyMFAResponse(data);
|
|
1788
|
-
yield put(actions.setLoginState({
|
|
1789
|
-
loading: false
|
|
1790
|
-
}));
|
|
1791
|
-
callback == null ? void 0 : callback(true);
|
|
1792
|
-
} catch (e) {
|
|
1793
|
-
yield put(actions.setLoginState({
|
|
1794
|
-
loading: false,
|
|
1795
|
-
error: errorHandler(e)
|
|
1796
|
-
}));
|
|
1797
|
-
callback == null ? void 0 : callback(null);
|
|
1798
|
-
}
|
|
1799
|
-
}
|
|
1800
|
-
function* preVerifyMFAWebAuthnForLogin(_ref22) {
|
|
1801
|
-
let {
|
|
1802
|
-
payload: {
|
|
1803
|
-
callback,
|
|
1804
|
-
deviceId
|
|
1805
|
-
}
|
|
1806
|
-
} = _ref22,
|
|
1807
|
-
payload = _objectWithoutPropertiesLoose(_ref22.payload, _excluded20);
|
|
1808
|
-
yield put(actions.setLoginState({
|
|
1809
|
-
loading: true
|
|
1810
|
-
}));
|
|
1811
|
-
try {
|
|
1812
|
-
var _data$options$allowCr;
|
|
1813
|
-
const data = yield call(api.auth.preVerifyMFAWebAuthnForLogin, deviceId, payload);
|
|
1814
|
-
const options = _extends({}, data.options, {
|
|
1815
|
-
challenge: base64urlDecode(data.options.challenge),
|
|
1816
|
-
allowCredentials: (_data$options$allowCr = data.options.allowCredentials) == null ? void 0 : _data$options$allowCr.map(credentials => _extends({}, credentials, {
|
|
1817
|
-
id: base64urlDecode(credentials.id)
|
|
1818
|
-
}))
|
|
1819
|
-
});
|
|
1820
|
-
yield put(actions.setLoginState({
|
|
1821
|
-
loading: false
|
|
1822
|
-
}));
|
|
1823
|
-
callback == null ? void 0 : callback({
|
|
1824
|
-
options,
|
|
1825
|
-
webauthnToken: data.webauthnToken
|
|
1826
|
-
});
|
|
1827
|
-
} catch (e) {
|
|
1828
|
-
yield put(actions.setLoginState({
|
|
1829
|
-
loading: false,
|
|
1830
|
-
error: errorHandler(e)
|
|
1831
|
-
}));
|
|
1832
|
-
callback == null ? void 0 : callback(null);
|
|
1833
|
-
}
|
|
1834
|
-
}
|
|
1835
|
-
function* verifyMFAWebAuthnForLogin(_ref23) {
|
|
1836
|
-
let {
|
|
1837
|
-
payload: {
|
|
1838
|
-
callback,
|
|
1839
|
-
deviceId
|
|
1840
|
-
}
|
|
1841
|
-
} = _ref23,
|
|
1842
|
-
payload = _objectWithoutPropertiesLoose(_ref23.payload, _excluded21);
|
|
1843
|
-
yield put(actions.setLoginState({
|
|
1844
|
-
loading: true
|
|
1845
|
-
}));
|
|
1846
|
-
try {
|
|
1847
|
-
const publicKey = publicKeyCredentialToJSON(payload.publicKey);
|
|
1848
|
-
const data = yield call(api.auth.verifyMFAWebAuthnForLoginV2, deviceId, _extends({}, payload, {
|
|
1849
|
-
options: publicKey
|
|
1850
|
-
}));
|
|
1851
|
-
yield handleVerifyMFAResponse(data);
|
|
1852
|
-
yield put(actions.setLoginState({
|
|
1853
|
-
loading: false
|
|
1854
|
-
}));
|
|
1855
|
-
callback == null ? void 0 : callback(true);
|
|
1856
|
-
} catch (e) {
|
|
1857
|
-
yield put(actions.setLoginState({
|
|
1858
|
-
loading: false,
|
|
1859
|
-
error: errorHandler(e)
|
|
1860
|
-
}));
|
|
1861
|
-
callback == null ? void 0 : callback(null);
|
|
1862
|
-
}
|
|
1863
|
-
}
|
|
1864
|
-
function* resetBreachedPassword({
|
|
1865
|
-
payload
|
|
1866
|
-
}) {
|
|
1867
|
-
yield put(actions.setLoginState({
|
|
1868
|
-
loading: true
|
|
1869
|
-
}));
|
|
1870
|
-
try {
|
|
1871
|
-
yield call(api.auth.forgotPassword, payload);
|
|
1872
|
-
yield put(actions.setLoginState({
|
|
1873
|
-
loading: false,
|
|
1874
|
-
error: undefined,
|
|
1875
|
-
step: LoginStep.breachedPasswordSuccess
|
|
1876
|
-
}));
|
|
1877
|
-
yield put(actions.setState({
|
|
1878
|
-
isAuthenticated: false
|
|
1879
|
-
}));
|
|
1880
|
-
} catch (e) {
|
|
1881
|
-
yield put(actions.setLoginState({
|
|
1882
|
-
loading: false,
|
|
1883
|
-
error: errorHandler(e)
|
|
1884
|
-
}));
|
|
1885
|
-
}
|
|
1886
|
-
}
|
|
1887
|
-
export function* loginSagas() {
|
|
1888
|
-
yield takeLeading(actions.requestAuthorize, requestAuthorize);
|
|
1889
|
-
yield takeLeading(actions.requestAuthorizeSSR, requestAuthorizeSSR);
|
|
1890
|
-
yield takeLeading(actions.requestHostedLoginAuthorize, refreshOrRequestHostedLoginAuthorize);
|
|
1891
|
-
yield takeLeading(actions.requestHostedLoginAuthorizeV2, refreshOrRequestHostedLoginAuthorizeV2);
|
|
1892
|
-
yield takeLeading(actions.handleHostedLoginCallback, handleHostedLoginCallback);
|
|
1893
|
-
yield takeLeading(actions.preLogin, preLogin);
|
|
1894
|
-
yield takeLeading(actions.postLogin, postLogin);
|
|
1895
|
-
yield takeLeading(actions.login, login);
|
|
1896
|
-
yield takeLeading(actions.logout, logout);
|
|
1897
|
-
yield takeLeading(actions.silentLogout, silentLogout);
|
|
1898
|
-
yield takeLeading(actions.loginWithMfa, loginWithMfa);
|
|
1899
|
-
yield takeLeading(actions.recoverMfa, recoverMfa);
|
|
1900
|
-
yield takeLeading(actions.quickSmsPasswordlessPreLogin, quickSmsPasswordlessPreLogin);
|
|
1901
|
-
yield takeLeading(actions.changePhoneNumberWithVerification, changePhoneNumberWithVerification);
|
|
1902
|
-
yield takeLeading(actions.verifyChangePhoneNumber, verifyChangePhoneNumber);
|
|
1903
|
-
yield takeLeading(actions.passwordlessPreLogin, passwordlessPreLogin);
|
|
1904
|
-
yield takeLeading(actions.passwordlessPostLogin, passwordlessPostLogin);
|
|
1905
|
-
yield takeLeading(actions.verifyInviteToken, verifyInviteToken);
|
|
1906
|
-
yield takeLeading(actions.webAuthnPrelogin, webAuthnPrelogin);
|
|
1907
|
-
yield takeLeading(actions.webAuthnPostLogin, webAuthnPostLogin);
|
|
1908
|
-
yield takeLeading(actions.webAuthnCreateNewDeviceSession, webAuthnCreateNewDeviceSession);
|
|
1909
|
-
yield takeLeading(actions.webAuthnVerifyNewDeviceSession, webAuthnVerifyNewDeviceSession);
|
|
1910
|
-
yield takeLeading(actions.afterAuthNavigation, afterAuthNavigation);
|
|
1911
|
-
yield takeLeading(actions.getUserIP, getUserIP);
|
|
1912
|
-
yield takeLeading(actions.preEnrollMFASMSForLogin, preEnrollMFASMSForLogin);
|
|
1913
|
-
yield takeLeading(actions.enrollMFASMSForLogin, enrollMFASMSForLogin);
|
|
1914
|
-
yield takeLeading(actions.preEnrollMFAWebAuthnForLogin, preEnrollMFAWebAuthnForLogin);
|
|
1915
|
-
yield takeLeading(actions.enrollMFAWebAuthnForLogin, enrollMFAWebAuthnForLogin);
|
|
1916
|
-
yield takeLeading(actions.enrollMFAAuthenticatorAppForLogin, enrollMFAAuthenticatorAppForLogin);
|
|
1917
|
-
yield takeLeading(actions.preVerifyMFASMSForLogin, preVerifyMFASMSForLogin);
|
|
1918
|
-
yield takeLeading(actions.verifyMFASMSForLogin, verifyMFASMSForLogin);
|
|
1919
|
-
yield takeLeading(actions.preVerifyMFAWebAuthnForLogin, preVerifyMFAWebAuthnForLogin);
|
|
1920
|
-
yield takeLeading(actions.verifyMFAWebAuthnForLogin, verifyMFAWebAuthnForLogin);
|
|
1921
|
-
yield takeLeading(actions.preVerifyMFAEmailCode, preVerifyMFAEmailCode);
|
|
1922
|
-
yield takeLeading(actions.verifyMFAEmailCode, verifyMFAEmailCode);
|
|
1923
|
-
yield takeLeading(actions.resetBreachedPassword, resetBreachedPassword);
|
|
1924
|
-
}
|
|
1925
|
-
|
|
1926
|
-
/*********************************
|
|
1927
|
-
* Preview Sagas
|
|
1928
|
-
*********************************/
|
|
1929
|
-
|
|
1930
|
-
function* requestAuthorizeMock({
|
|
1931
|
-
payload: firstTime
|
|
1932
|
-
}) {
|
|
1933
|
-
if (firstTime) {
|
|
1934
|
-
yield put(actions.setState({
|
|
1935
|
-
isLoading: true
|
|
1936
|
-
}));
|
|
1937
|
-
}
|
|
1938
|
-
const user = userDemo;
|
|
1939
|
-
yield put(actions.loadTenants());
|
|
1940
|
-
yield put(actions.setState({
|
|
1941
|
-
user,
|
|
1942
|
-
isAuthenticated: true,
|
|
1943
|
-
isLoading: false
|
|
1944
|
-
}));
|
|
1945
|
-
}
|
|
1946
|
-
function* getUserIPMock({
|
|
1947
|
-
payload: {
|
|
1948
|
-
callback
|
|
1949
|
-
}
|
|
1950
|
-
}) {
|
|
1951
|
-
try {
|
|
1952
|
-
const {
|
|
1953
|
-
ip
|
|
1954
|
-
} = dummyIps[0];
|
|
1955
|
-
yield put(actions.setState({
|
|
1956
|
-
userIp: ip
|
|
1957
|
-
}));
|
|
1958
|
-
callback == null ? void 0 : callback(true, ip);
|
|
1959
|
-
} catch (e) {
|
|
1960
|
-
callback == null ? void 0 : callback(false, e);
|
|
1961
|
-
}
|
|
1962
|
-
}
|
|
1963
|
-
export function* loginSagasMock() {
|
|
1964
|
-
yield takeLeading(actions.requestAuthorize, requestAuthorizeMock);
|
|
1965
|
-
yield takeLeading(actions.afterAuthNavigation, afterAuthNavigation);
|
|
1966
|
-
yield takeLeading(actions.getUserIP, getUserIPMock);
|
|
1967
|
-
}
|