From 76a5a5dffa90cb7ec0cbca65f13914d4af229d71 Mon Sep 17 00:00:00 2001 From: ayesha waris <73840786+ayesha-waris@users.noreply.github.com> Date: Fri, 29 Nov 2024 16:30:23 +0500 Subject: [PATCH] fix: fixed event data (#1383) --- src/common-components/RedirectLogistration.jsx | 9 +++++++-- src/login/LoginPage.jsx | 6 +++--- src/register/RegistrationPage.jsx | 6 +++--- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/common-components/RedirectLogistration.jsx b/src/common-components/RedirectLogistration.jsx index c9e517f0..b626684d 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 b21d1a9c..fcb61c94 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 && !(