From cd2003921b22826825188e1d5ec4f7bf245366b9 Mon Sep 17 00:00:00 2001 From: ayesha waris <73840786+ayesha-waris@users.noreply.github.com> Date: Wed, 27 Nov 2024 18:56:03 +0500 Subject: [PATCH] fix: fixed duplicate event firing on post SSO login registration (#1381) --- src/login/LoginPage.jsx | 5 ++++- src/register/RegistrationPage.jsx | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/login/LoginPage.jsx b/src/login/LoginPage.jsx index 27b97e60f..b21d1a9c5 100644 --- a/src/login/LoginPage.jsx +++ b/src/login/LoginPage.jsx @@ -160,7 +160,10 @@ const LoginPage = (props) => { webElementText: ELEMENT_TEXT.SIGN_IN, webElementName: ELEMENT_NAME.SIGN_IN, }; - dispatch(setCohesionEventStates(eventData)); + if (currentProvider) { + dispatch(setCohesionEventStates(eventData)); + } + if (showResetPasswordSuccessBanner) { props.dismissPasswordResetBanner(); } diff --git a/src/register/RegistrationPage.jsx b/src/register/RegistrationPage.jsx index 16d0e0b1b..5407ca859 100644 --- a/src/register/RegistrationPage.jsx +++ b/src/register/RegistrationPage.jsx @@ -278,7 +278,9 @@ const RegistrationPage = (props) => { webElementText: ELEMENT_TEXT.CREATE_ACCOUNT, webElementName: ELEMENT_NAME.CREATE_ACCOUNT, }; - dispatch(setCohesionEventStates(eventData)); + if (currentProvider) { + dispatch(setCohesionEventStates(eventData)); + } registerUser(); };