feat: replace legacy url with account mfe url
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
@@ -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',
|
||||
});
|
||||
|
||||
@@ -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) => {
|
||||
</p>
|
||||
<a
|
||||
className="btn btn-primary"
|
||||
href={`${getConfig().LMS_BASE_URL}/${returnUrl}`}
|
||||
href={URL}
|
||||
data-testid="return-button"
|
||||
>
|
||||
{props.intl.formatMessage(messages[returnText])}
|
||||
|
||||
Reference in New Issue
Block a user