diff --git a/openedx/core/djangoapps/user_api/legacy_urls.py b/openedx/core/djangoapps/user_api/legacy_urls.py index ad02f7f19c..3c8da9bd83 100644 --- a/openedx/core/djangoapps/user_api/legacy_urls.py +++ b/openedx/core/djangoapps/user_api/legacy_urls.py @@ -1,7 +1,9 @@ """ Defines the URL routes for this app. """ +from django.conf import settings from django.urls import path, re_path, include +from django.views.generic import RedirectView from rest_framework import routers from . import views as user_api_views @@ -12,6 +14,10 @@ USER_API_ROUTER.register(r'users', user_api_views.UserViewSet) USER_API_ROUTER.register(r'user_prefs', user_api_views.UserPreferenceViewSet) urlpatterns = [ + # This redirect is needed for backward compatibility with the old URL structure for the authentication + # workflows using third-party authentication providers until the authentication workflows fully support + # the URL structure with MFEs. + re_path(r'^account(?:/settings)?/?$', RedirectView.as_view(url=settings.ACCOUNT_MICROFRONTEND_URL)), path('user_api/v1/', include(USER_API_ROUTER.urls)), re_path( fr'^user_api/v1/preferences/(?P{UserPreference.KEY_REGEX})/users/$',