diff --git a/src/common-components/RedirectLogistration.jsx b/src/common-components/RedirectLogistration.jsx index c9e517f0f..b626684df 100644 --- a/src/common-components/RedirectLogistration.jsx +++ b/src/common-components/RedirectLogistration.jsx @@ -24,13 +24,16 @@ const RedirectLogistration = (props) => { userId, registrationEmbedded, host, + currectProvider, } = props; const cohesionEventData = useSelector(state => state.cohesion.eventData); let finalRedirectUrl = ''; if (success) { - // This event is used by cohesion upon successful login - trackCohesionEvent(cohesionEventData); + // This event is used by cohesion upon successful login and registration + if (!currectProvider) { + trackCohesionEvent(cohesionEventData); + } // If we're in a third party auth pipeline, we must complete the pipeline // once user has successfully logged in. Otherwise, redirect to the specified redirect url. // Note: For multiple enterprise use case, we need to make sure that user first visits the @@ -100,6 +103,7 @@ RedirectLogistration.defaultProps = { userId: null, registrationEmbedded: false, host: '', + currectProvider: '', }; RedirectLogistration.propTypes = { @@ -114,6 +118,7 @@ RedirectLogistration.propTypes = { userId: PropTypes.number, registrationEmbedded: PropTypes.bool, host: PropTypes.string, + currectProvider: PropTypes.string, }; export default RedirectLogistration; diff --git a/src/login/LoginPage.jsx b/src/login/LoginPage.jsx index b21d1a9c5..fcb61c942 100644 --- a/src/login/LoginPage.jsx +++ b/src/login/LoginPage.jsx @@ -160,9 +160,8 @@ const LoginPage = (props) => { webElementText: ELEMENT_TEXT.SIGN_IN, webElementName: ELEMENT_NAME.SIGN_IN, }; - if (currentProvider) { - dispatch(setCohesionEventStates(eventData)); - } + + dispatch(setCohesionEventStates(eventData)); if (showResetPasswordSuccessBanner) { props.dismissPasswordResetBanner(); @@ -229,6 +228,7 @@ const LoginPage = (props) => { success={loginResult.success} redirectUrl={loginResult.redirectUrl} finishAuthUrl={finishAuthUrl} + currentProvider={currentProvider} />
{ webElementText: ELEMENT_TEXT.CREATE_ACCOUNT, webElementName: ELEMENT_NAME.CREATE_ACCOUNT, }; - if (currentProvider) { - dispatch(setCohesionEventStates(eventData)); - } + + dispatch(setCohesionEventStates(eventData)); registerUser(); }; @@ -315,6 +314,7 @@ const RegistrationPage = (props) => { redirectToProgressiveProfilingPage={ getConfig().ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN && !!Object.keys(optionalFields.fields).length } + currentProvider={currentProvider} /> {(autoSubmitRegForm && !errorCode.type) || (!autoGeneratedUsernameExpVariation && !(