diff --git a/src/account-settings/name-change/NameChange.jsx b/src/account-settings/name-change/NameChange.jsx index 35bbda4..1235c2a 100644 --- a/src/account-settings/name-change/NameChange.jsx +++ b/src/account-settings/name-change/NameChange.jsx @@ -69,7 +69,7 @@ const NameChangeModal = ({ useEffect(() => { if (saveState === 'complete') { handleClose(); - navigate(`/id-verification?next=${encodeURIComponent('account/settings')}`); + navigate(`/id-verification?next=${encodeURIComponent('/')}`); } }, [handleClose, navigate, saveState]); diff --git a/src/hooks.js b/src/hooks.js index 6d3feca..dbc1493 100644 --- a/src/hooks.js +++ b/src/hooks.js @@ -42,11 +42,13 @@ export function useRedirect() { useEffect(() => { if (sessionStorage.getItem('courseId')) { setRedirect({ + isAccountMFERedirect: false, location: `courses/${sessionStorage.getItem('courseId')}`, text: 'id.verification.return.course', }); } else if (sessionStorage.getItem('next')) { setRedirect({ + isAccountMFERedirect: true, location: sessionStorage.getItem('next'), text: 'id.verification.return.generic', }); diff --git a/src/id-verification/panels/SubmittedPanel.jsx b/src/id-verification/panels/SubmittedPanel.jsx index 6397e07..a6aa786 100644 --- a/src/id-verification/panels/SubmittedPanel.jsx +++ b/src/id-verification/panels/SubmittedPanel.jsx @@ -12,8 +12,9 @@ import BasePanel from './BasePanel'; const SubmittedPanel = (props) => { const { userId } = useContext(IdVerificationContext); - const { location: returnUrl, text: returnText } = useRedirect(); + const { location: returnUrl, text: returnText, isAccountMFERedirect } = useRedirect(); const panelSlug = 'submitted'; + const URL = isAccountMFERedirect ? returnUrl : `${getConfig().LMS_BASE_URL}/${returnUrl}`; useEffect(() => { sendTrackEvent('edx.id_verification.submitted', { @@ -32,7 +33,7 @@ const SubmittedPanel = (props) => {
{props.intl.formatMessage(messages[returnText])}