diff --git a/src/common-components/Logistration.jsx b/src/common-components/Logistration.jsx index 9a31373f..cc8c1101 100644 --- a/src/common-components/Logistration.jsx +++ b/src/common-components/Logistration.jsx @@ -20,6 +20,7 @@ import { getTpaHint, getTpaProvider, updatePathWithQueryParams } from '../data/u import { LoginPage } from '../login'; import { RegistrationPage } from '../register'; import { backupRegistrationForm } from '../register/data/actions'; +import { clearThirdPartyAuthContextErrorMessage } from './data/actions'; import { tpaProvidersSelector, } from './data/selectors'; @@ -56,6 +57,7 @@ const Logistration = (props) => { const handleOnSelect = (tabKey) => { sendTrackEvent(`edx.bi.${tabKey.replace('/', '')}_form.toggled`, { category: 'user-engagement' }); + props.clearThirdPartyAuthContextErrorMessage(); if (tabKey === LOGIN_PAGE) { props.backupRegistrationForm(); } @@ -135,6 +137,7 @@ const Logistration = (props) => { Logistration.propTypes = { selectedPage: PropTypes.string, backupRegistrationForm: PropTypes.func.isRequired, + clearThirdPartyAuthContextErrorMessage: PropTypes.func.isRequired, tpaProviders: PropTypes.shape({ providers: PropTypes.arrayOf(PropTypes.shape({})), secondaryProviders: PropTypes.arrayOf(PropTypes.shape({})), @@ -160,5 +163,6 @@ export default connect( mapStateToProps, { backupRegistrationForm, + clearThirdPartyAuthContextErrorMessage, }, )(Logistration); diff --git a/src/common-components/RedirectLogistration.jsx b/src/common-components/RedirectLogistration.jsx index c9bc1e21..862845ca 100644 --- a/src/common-components/RedirectLogistration.jsx +++ b/src/common-components/RedirectLogistration.jsx @@ -21,9 +21,6 @@ const RedirectLogistration = (props) => { let finalRedirectUrl = ''; if (success) { - // After successful registeration remove the tpaHintedAuthentication flag from local storage if set - localStorage.removeItem('tpaHintedAuthentication'); - // 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 diff --git a/src/common-components/SocialAuthProviders.jsx b/src/common-components/SocialAuthProviders.jsx index c5cea3fc..9d80ea3d 100644 --- a/src/common-components/SocialAuthProviders.jsx +++ b/src/common-components/SocialAuthProviders.jsx @@ -13,13 +13,9 @@ const SocialAuthProviders = (props) => { const { formatMessage } = useIntl(); const { referrer, socialAuthProviders } = props; - function handleSubmit(e, skipRegistrationForm) { + function handleSubmit(e) { e.preventDefault(); - if (skipRegistrationForm) { - localStorage.setItem('tpaHintedAuthentication', 'true'); - } - const url = e.currentTarget.dataset.providerUrl; window.location.href = getConfig().LMS_BASE_URL + url; } @@ -31,7 +27,7 @@ const SocialAuthProviders = (props) => { type="button" className={`btn-social btn-${provider.id} ${index % 2 === 0 ? 'mr-3' : ''}`} data-provider-url={referrer === LOGIN_PAGE ? provider.loginUrl : provider.registerUrl} - onClick={(e) => handleSubmit(e, provider.skipRegistrationForm)} + onClick={handleSubmit} > {provider.iconImage ? (