diff --git a/src/common-components/UnAuthOnlyRoute.jsx b/src/common-components/UnAuthOnlyRoute.jsx index 7be62aae..3e05fe0b 100644 --- a/src/common-components/UnAuthOnlyRoute.jsx +++ b/src/common-components/UnAuthOnlyRoute.jsx @@ -4,9 +4,7 @@ import { getConfig } from '@edx/frontend-platform'; import { fetchAuthenticatedUser, getAuthenticatedUser } from '@edx/frontend-platform/auth'; import PropTypes from 'prop-types'; -import { - DEFAULT_REDIRECT_URL, -} from '../data/constants'; +import { updatePathWithQueryParams } from '../data/utils'; /** * This wrapper redirects the requester to our default redirect url if they are @@ -25,7 +23,8 @@ const UnAuthOnlyRoute = ({ children }) => { if (isReady) { if (authUser && authUser.username) { - global.location.href = getConfig().LMS_BASE_URL.concat(DEFAULT_REDIRECT_URL); + const updatedPath = updatePathWithQueryParams(window.location.pathname); + global.location.href = getConfig().LMS_BASE_URL.concat(updatedPath); return null; }