feat: make ACCOUNT_MICROFRONTEND_URL site aware.

This commit is contained in:
Felipe Bermúdez-Mendoza
2026-03-02 11:43:23 +01:00
committed by Feanil Patel
parent 85e81b32e4
commit b367336d60
22 changed files with 521 additions and 17 deletions

View File

@@ -6,6 +6,8 @@ from django.urls import path, re_path, include
from django.views.generic import RedirectView
from rest_framework import routers
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from . import views as user_api_views
from .models import UserPreference
@@ -17,7 +19,12 @@ 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)),
re_path(r'^account(?:/settings)?/?$', RedirectView.as_view(
url=configuration_helpers.get_value(
'ACCOUNT_MICROFRONTEND_URL',
settings.ACCOUNT_MICROFRONTEND_URL,
)),
),
path('user_api/v1/', include(USER_API_ROUTER.urls)),
re_path(
fr'^user_api/v1/preferences/(?P<pref_key>{UserPreference.KEY_REGEX})/users/$',