From 9575cf074c8e440b5a3d5d2e1e7f957454448e59 Mon Sep 17 00:00:00 2001 From: ssurendrannair Date: Wed, 24 Jun 2026 10:50:12 +0000 Subject: [PATCH 01/10] fix: restore missing Segment analytics events in Authn MFE --- src/data/constants.js | 2 +- src/login/LoginPage.jsx | 29 ++++++++++++++++++++++------- src/logistration/Logistration.jsx | 8 ++++---- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/data/constants.js b/src/data/constants.js index d389c3e21b..cb09e5a38c 100644 --- a/src/data/constants.js +++ b/src/data/constants.js @@ -9,7 +9,7 @@ export const RECOMMENDATIONS = '/recommendations'; export const PASSWORD_RESET_CONFIRM = '/password_reset_confirm/:token/'; export const PAGE_NOT_FOUND = '/notfound'; export const ENTERPRISE_LOGIN_URL = '/enterprise/login'; -export const APP_NAME = 'authn'; +export const APP_NAME = 'authn_mfe'; // Constants export const SUPPORTED_ICON_CLASSES = ['apple', 'facebook', 'google', 'microsoft']; diff --git a/src/login/LoginPage.jsx b/src/login/LoginPage.jsx index 1779ae1efe..e1a7ede35e 100644 --- a/src/login/LoginPage.jsx +++ b/src/login/LoginPage.jsx @@ -2,16 +2,19 @@ import { useCallback, useEffect, useMemo, useState, } from 'react'; import { useDispatch, useSelector } from 'react-redux'; - +import { + trackForgotPasswordLinkClick, trackLoginPageViewed, trackLoginSuccess, +} from '../tracking/trackers/login'; +import { setCohesionEventStates } from '../cohesion/data/actions'; +import { ELEMENT_NAME, ELEMENT_TEXT, ELEMENT_TYPES, PAGE_TYPES } from '../cohesion/constants'; import { getConfig } from '@edx/frontend-platform'; -import { sendPageEvent, sendTrackEvent } from '@edx/frontend-platform/analytics'; import { useIntl } from '@edx/frontend-platform/i18n'; import { Form, StatefulButton } from '@openedx/paragon'; import PropTypes from 'prop-types'; import { Helmet } from 'react-helmet'; import Skeleton from 'react-loading-skeleton'; import { Link } from 'react-router-dom'; - +import { removeCookie } from '../data/utils/cookies'; import { FormGroup, InstitutionLogistration, @@ -96,7 +99,7 @@ const LoginPage = ({ const tpaHint = getTpaHint(); useEffect(() => { - sendPageEvent('login_and_registration', 'login'); + trackLoginPageViewed(); }, []); useEffect(() => { @@ -140,6 +143,13 @@ const LoginPage = ({ } }, [thirdPartyErrorMessage]); + useEffect(() => { + if (loginResult.success) { + trackLoginSuccess(); + removeCookie('ssoPipelineRedirectionDone'); + } + }, [loginResult]); + const validateFormFields = (payload) => { const { emailOrUsername, @@ -183,6 +193,13 @@ const LoginPage = ({ password: formData.password, ...queryParams, }; + const eventData = { + pageType: PAGE_TYPES.SIGN_IN, + elementType: ELEMENT_TYPES.BUTTON, + webElementText: ELEMENT_TEXT.SIGN_IN, + webElementName: ELEMENT_NAME.SIGN_IN, + }; + dispatch(setCohesionEventStates(eventData)); dispatch(loginRequest(payload)); }; @@ -204,9 +221,6 @@ const LoginPage = ({ [name]: '', })); }; - const trackForgotPasswordLinkClick = () => { - sendTrackEvent('edx.bi.password-reset_form.toggled', { category: 'user-engagement' }); - }; const { provider, @@ -246,6 +260,7 @@ const LoginPage = ({ success={loginResult.success} redirectUrl={loginResult.redirectUrl} finishAuthUrl={finishAuthUrl} + currectProvider={currentProvider} />
{ if (disablePublicAccountCreation) { @@ -72,7 +72,7 @@ const Logistration = ({ }, [navigate, disablePublicAccountCreation]); const handleInstitutionLogin = (e) => { - sendTrackEvent('edx.bi.institution_login_form.toggled', { category: 'user-engagement' }); + sendTrackEvent('edx.bi.institution_login_form.toggled', { category: 'user-engagement', app_name: APP_NAME }); if (typeof e === 'string') { sendPageEvent('login_and_registration', e === '/login' ? 'login' : 'register'); } else { @@ -86,7 +86,7 @@ const Logistration = ({ if (tabKey === currentTab) { return; } - sendTrackEvent(`edx.bi.${tabKey.replace('/', '')}_form.toggled`, { category: 'user-engagement' }); + sendTrackEvent(`edx.bi.${tabKey.replace('/', '')}_form.toggled`, { category: 'user-engagement', app_name: APP_NAME }); dispatch(clearThirdPartyAuthContextErrorMessage()); if (tabKey === LOGIN_PAGE) { dispatch(backupRegistrationForm()); From c2ee38904195f0145c968b14891ac34c19a8b7eb Mon Sep 17 00:00:00 2001 From: ssurendrannair Date: Wed, 24 Jun 2026 11:03:01 +0000 Subject: [PATCH 02/10] fix: restore missing Segment analytics events in Authn MFE --- src/login/LoginPage.jsx | 16 +++++++++------- src/logistration/Logistration.jsx | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/login/LoginPage.jsx b/src/login/LoginPage.jsx index e1a7ede35e..eeed4a416d 100644 --- a/src/login/LoginPage.jsx +++ b/src/login/LoginPage.jsx @@ -2,11 +2,7 @@ import { useCallback, useEffect, useMemo, useState, } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { - trackForgotPasswordLinkClick, trackLoginPageViewed, trackLoginSuccess, -} from '../tracking/trackers/login'; -import { setCohesionEventStates } from '../cohesion/data/actions'; -import { ELEMENT_NAME, ELEMENT_TEXT, ELEMENT_TYPES, PAGE_TYPES } from '../cohesion/constants'; + import { getConfig } from '@edx/frontend-platform'; import { useIntl } from '@edx/frontend-platform/i18n'; import { Form, StatefulButton } from '@openedx/paragon'; @@ -14,7 +10,9 @@ import PropTypes from 'prop-types'; import { Helmet } from 'react-helmet'; import Skeleton from 'react-loading-skeleton'; import { Link } from 'react-router-dom'; -import { removeCookie } from '../data/utils/cookies'; + +import { ELEMENT_NAME, ELEMENT_TEXT, ELEMENT_TYPES, PAGE_TYPES } from '../cohesion/constants'; +import { setCohesionEventStates } from '../cohesion/data/actions'; import { FormGroup, InstitutionLogistration, @@ -22,7 +20,6 @@ import { RedirectLogistration, ThirdPartyAuthAlert, } from '../common-components'; -import AccountActivationMessage from './AccountActivationMessage'; import { getThirdPartyAuthContext } from '../common-components/data/actions'; import { thirdPartyAuthContextSelector } from '../common-components/data/selectors'; import EnterpriseSSO from '../common-components/EnterpriseSSO'; @@ -35,7 +32,12 @@ import { getTpaProvider, updatePathWithQueryParams, } from '../data/utils'; +import { removeCookie } from '../data/utils/cookies'; import ResetPasswordSuccess from '../reset-password/ResetPasswordSuccess'; +import { + trackForgotPasswordLinkClick, trackLoginPageViewed, trackLoginSuccess, +} from '../tracking/trackers/login'; +import AccountActivationMessage from './AccountActivationMessage'; import { backupLoginFormBegin, dismissPasswordResetBanner, loginRequest } from './data/actions'; import { INVALID_FORM, TPA_AUTHENTICATION_FAILURE } from './data/constants'; import LoginFailureMessage from './LoginFailure'; diff --git a/src/logistration/Logistration.jsx b/src/logistration/Logistration.jsx index b75e68b910..fb5302f8ca 100644 --- a/src/logistration/Logistration.jsx +++ b/src/logistration/Logistration.jsx @@ -21,7 +21,7 @@ import { tpaProvidersSelector, } from '../common-components/data/selectors'; import messages from '../common-components/messages'; -import { LOGIN_PAGE, REGISTER_PAGE, APP_NAME } from '../data/constants'; +import { APP_NAME, LOGIN_PAGE, REGISTER_PAGE } from '../data/constants'; import { getTpaHint, getTpaProvider, updatePathWithQueryParams, } from '../data/utils'; From 3a058c8bcb1a0c2b739a223ee840773c7bfba0c3 Mon Sep 17 00:00:00 2001 From: ssurendrannair Date: Wed, 24 Jun 2026 11:07:22 +0000 Subject: [PATCH 03/10] fix: restore missing Segment analytics events in Authn MFE --- src/login/LoginPage.jsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/login/LoginPage.jsx b/src/login/LoginPage.jsx index eeed4a416d..10cbb580be 100644 --- a/src/login/LoginPage.jsx +++ b/src/login/LoginPage.jsx @@ -11,8 +11,18 @@ import { Helmet } from 'react-helmet'; import Skeleton from 'react-loading-skeleton'; import { Link } from 'react-router-dom'; -import { ELEMENT_NAME, ELEMENT_TEXT, ELEMENT_TYPES, PAGE_TYPES } from '../cohesion/constants'; +import { + ELEMENT_NAME, + ELEMENT_TEXT, + ELEMENT_TYPES, + PAGE_TYPES, +} from '../cohesion/constants'; import { setCohesionEventStates } from '../cohesion/data/actions'; +import AccountActivationMessage from './AccountActivationMessage'; +import { backupLoginFormBegin, dismissPasswordResetBanner, loginRequest } from './data/actions'; +import { INVALID_FORM, TPA_AUTHENTICATION_FAILURE } from './data/constants'; +import LoginFailureMessage from './LoginFailure'; +import messages from './messages'; import { FormGroup, InstitutionLogistration, @@ -37,11 +47,6 @@ import ResetPasswordSuccess from '../reset-password/ResetPasswordSuccess'; import { trackForgotPasswordLinkClick, trackLoginPageViewed, trackLoginSuccess, } from '../tracking/trackers/login'; -import AccountActivationMessage from './AccountActivationMessage'; -import { backupLoginFormBegin, dismissPasswordResetBanner, loginRequest } from './data/actions'; -import { INVALID_FORM, TPA_AUTHENTICATION_FAILURE } from './data/constants'; -import LoginFailureMessage from './LoginFailure'; -import messages from './messages'; const DEFAULT_LOGIN_FORM_DATA = { formFields: { emailOrUsername: '', password: '' }, From f66a85d79a1a7ad6e2a77d6c6bfe849f0e6d780a Mon Sep 17 00:00:00 2001 From: ssurendrannair Date: Wed, 24 Jun 2026 11:11:17 +0000 Subject: [PATCH 04/10] fix: restore missing Segment analytics events in Authn MFE --- src/login/LoginPage.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/login/LoginPage.jsx b/src/login/LoginPage.jsx index 10cbb580be..9fc6b880bd 100644 --- a/src/login/LoginPage.jsx +++ b/src/login/LoginPage.jsx @@ -17,12 +17,6 @@ import { ELEMENT_TYPES, PAGE_TYPES, } from '../cohesion/constants'; -import { setCohesionEventStates } from '../cohesion/data/actions'; -import AccountActivationMessage from './AccountActivationMessage'; -import { backupLoginFormBegin, dismissPasswordResetBanner, loginRequest } from './data/actions'; -import { INVALID_FORM, TPA_AUTHENTICATION_FAILURE } from './data/constants'; -import LoginFailureMessage from './LoginFailure'; -import messages from './messages'; import { FormGroup, InstitutionLogistration, @@ -34,6 +28,7 @@ import { getThirdPartyAuthContext } from '../common-components/data/actions'; import { thirdPartyAuthContextSelector } from '../common-components/data/selectors'; import EnterpriseSSO from '../common-components/EnterpriseSSO'; import ThirdPartyAuth from '../common-components/ThirdPartyAuth'; +import { setCohesionEventStates } from '../cohesion/data/actions'; import { PENDING_STATE, RESET_PAGE } from '../data/constants'; import { getActivationStatus, @@ -47,6 +42,11 @@ import ResetPasswordSuccess from '../reset-password/ResetPasswordSuccess'; import { trackForgotPasswordLinkClick, trackLoginPageViewed, trackLoginSuccess, } from '../tracking/trackers/login'; +import AccountActivationMessage from './AccountActivationMessage'; +import { backupLoginFormBegin, dismissPasswordResetBanner, loginRequest } from './data/actions'; +import { INVALID_FORM, TPA_AUTHENTICATION_FAILURE } from './data/constants'; +import LoginFailureMessage from './LoginFailure'; +import messages from './messages'; const DEFAULT_LOGIN_FORM_DATA = { formFields: { emailOrUsername: '', password: '' }, From c4cc7311b48947f64656ded3b8bcc0bc472f8016 Mon Sep 17 00:00:00 2001 From: ssurendrannair Date: Wed, 24 Jun 2026 11:16:08 +0000 Subject: [PATCH 05/10] fix: restore missing Segment analytics events in Authn MFE --- src/login/LoginPage.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/login/LoginPage.jsx b/src/login/LoginPage.jsx index 9fc6b880bd..3a44bd6419 100644 --- a/src/login/LoginPage.jsx +++ b/src/login/LoginPage.jsx @@ -11,12 +11,14 @@ import { Helmet } from 'react-helmet'; import Skeleton from 'react-loading-skeleton'; import { Link } from 'react-router-dom'; +import AccountActivationMessage from './AccountActivationMessage'; import { ELEMENT_NAME, ELEMENT_TEXT, ELEMENT_TYPES, PAGE_TYPES, } from '../cohesion/constants'; +import { setCohesionEventStates } from '../cohesion/data/actions'; import { FormGroup, InstitutionLogistration, @@ -24,11 +26,12 @@ import { RedirectLogistration, ThirdPartyAuthAlert, } from '../common-components'; +import LoginFailureMessage from './LoginFailure'; +import messages from './messages'; import { getThirdPartyAuthContext } from '../common-components/data/actions'; import { thirdPartyAuthContextSelector } from '../common-components/data/selectors'; import EnterpriseSSO from '../common-components/EnterpriseSSO'; import ThirdPartyAuth from '../common-components/ThirdPartyAuth'; -import { setCohesionEventStates } from '../cohesion/data/actions'; import { PENDING_STATE, RESET_PAGE } from '../data/constants'; import { getActivationStatus, @@ -37,16 +40,13 @@ import { getTpaProvider, updatePathWithQueryParams, } from '../data/utils'; +import { backupLoginFormBegin, dismissPasswordResetBanner, loginRequest } from './data/actions'; import { removeCookie } from '../data/utils/cookies'; import ResetPasswordSuccess from '../reset-password/ResetPasswordSuccess'; +import { INVALID_FORM, TPA_AUTHENTICATION_FAILURE } from './data/constants'; import { trackForgotPasswordLinkClick, trackLoginPageViewed, trackLoginSuccess, } from '../tracking/trackers/login'; -import AccountActivationMessage from './AccountActivationMessage'; -import { backupLoginFormBegin, dismissPasswordResetBanner, loginRequest } from './data/actions'; -import { INVALID_FORM, TPA_AUTHENTICATION_FAILURE } from './data/constants'; -import LoginFailureMessage from './LoginFailure'; -import messages from './messages'; const DEFAULT_LOGIN_FORM_DATA = { formFields: { emailOrUsername: '', password: '' }, From d177e9659c2400f75ffe536e43ab791f23e1c136 Mon Sep 17 00:00:00 2001 From: ssurendrannair Date: Wed, 24 Jun 2026 11:21:22 +0000 Subject: [PATCH 06/10] fix: restore missing Segment analytics events in Authn MFE --- src/login/tests/LoginPage.test.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/login/tests/LoginPage.test.jsx b/src/login/tests/LoginPage.test.jsx index 7bcd04d989..3a86f4cd8b 100644 --- a/src/login/tests/LoginPage.test.jsx +++ b/src/login/tests/LoginPage.test.jsx @@ -762,7 +762,11 @@ describe('LoginPage', () => { it('should send page event when login page is rendered', () => { render(reduxWrapper()); - expect(sendPageEvent).toHaveBeenCalledWith('login_and_registration', 'login'); + expect(sendPageEvent).toHaveBeenCalledWith( + 'login_and_registration', + 'login', + { app_name: 'authn_mfe' }, + ); }); it('tests that form is in invalid state when it is submitted', () => { From d6cbd6895b7ae51022f0faf3d688706a9fd46d1e Mon Sep 17 00:00:00 2001 From: ssurendrannair Date: Wed, 1 Jul 2026 05:19:06 +0000 Subject: [PATCH 07/10] fix: restore missing Segment analytics events in Authn MFE --- src/logistration/Logistration.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/logistration/Logistration.jsx b/src/logistration/Logistration.jsx index fb5302f8ca..8f98ed54c7 100644 --- a/src/logistration/Logistration.jsx +++ b/src/logistration/Logistration.jsx @@ -74,9 +74,9 @@ const Logistration = ({ const handleInstitutionLogin = (e) => { sendTrackEvent('edx.bi.institution_login_form.toggled', { category: 'user-engagement', app_name: APP_NAME }); if (typeof e === 'string') { - sendPageEvent('login_and_registration', e === '/login' ? 'login' : 'register'); + sendPageEvent('login_and_registration', e === '/login' ? 'login' : 'register', { app_name: APP_NAME }); } else { - sendPageEvent('login_and_registration', e.target.dataset.eventName); + sendPageEvent('login_and_registration', e.target.dataset.eventName, { app_name: APP_NAME }); } setInstitutionLogin(!institutionLogin); From b8060a9399d77fad54efb67df65b9df67b66d554 Mon Sep 17 00:00:00 2001 From: ssurendrannair Date: Wed, 1 Jul 2026 05:31:49 +0000 Subject: [PATCH 08/10] fix: restore missing Segment analytics events in Authn MFE --- src/logistration/Logistration.test.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/logistration/Logistration.test.jsx b/src/logistration/Logistration.test.jsx index a886a38bcb..07f92d2a50 100644 --- a/src/logistration/Logistration.test.jsx +++ b/src/logistration/Logistration.test.jsx @@ -249,6 +249,7 @@ describe('Logistration', () => { expect(sendPageEvent).toHaveBeenCalledWith( 'login_and_registration', 'institution_login', + { app_name: 'authn_mfe' }, ); mergeConfig({ From bcb1081a3320687787708ec4afdee663ffc75d64 Mon Sep 17 00:00:00 2001 From: ssurendrannair Date: Thu, 2 Jul 2026 07:18:11 +0000 Subject: [PATCH 09/10] fix: restore missing Segment analytics events in Authn MFE --- src/logistration/Logistration.test.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/logistration/Logistration.test.jsx b/src/logistration/Logistration.test.jsx index 07f92d2a50..9935b08f72 100644 --- a/src/logistration/Logistration.test.jsx +++ b/src/logistration/Logistration.test.jsx @@ -11,7 +11,7 @@ import configureStore from 'redux-mock-store'; import Logistration from './Logistration'; import { clearThirdPartyAuthContextErrorMessage } from '../common-components/data/actions'; import { - COMPLETE_STATE, LOGIN_PAGE, REGISTER_PAGE, + APP_NAME, COMPLETE_STATE, LOGIN_PAGE, REGISTER_PAGE, } from '../data/constants'; import { backupLoginForm } from '../login/data/actions'; import { backupRegistrationForm } from '../register/data/actions'; @@ -249,7 +249,7 @@ describe('Logistration', () => { expect(sendPageEvent).toHaveBeenCalledWith( 'login_and_registration', 'institution_login', - { app_name: 'authn_mfe' }, + { app_name: APP_NAME }, ); mergeConfig({ From 232080b3829d9fc8df503fc8526e3b317b11eb3e Mon Sep 17 00:00:00 2001 From: ssurendrannair Date: Thu, 2 Jul 2026 07:26:20 +0000 Subject: [PATCH 10/10] fix: restore missing Segment analytics events in Authn MFE --- src/logistration/Logistration.test.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logistration/Logistration.test.jsx b/src/logistration/Logistration.test.jsx index 9935b08f72..cf5be86732 100644 --- a/src/logistration/Logistration.test.jsx +++ b/src/logistration/Logistration.test.jsx @@ -11,7 +11,7 @@ import configureStore from 'redux-mock-store'; import Logistration from './Logistration'; import { clearThirdPartyAuthContextErrorMessage } from '../common-components/data/actions'; import { - APP_NAME, COMPLETE_STATE, LOGIN_PAGE, REGISTER_PAGE, + APP_NAME, COMPLETE_STATE, LOGIN_PAGE, REGISTER_PAGE, } from '../data/constants'; import { backupLoginForm } from '../login/data/actions'; import { backupRegistrationForm } from '../register/data/actions';