From 55d2a4f8976feebecd3aba09e35ef480d4d2417d Mon Sep 17 00:00:00 2001 From: adeelehsan <adeel.ehsan@arbisoft.com> Date: Tue, 19 Jan 2021 00:39:24 +0500 Subject: [PATCH] Logistration MFE renamed to authn VAN-300 --- common/djangoapps/student/forms.py | 4 ++-- .../student/tests/test_activate_account.py | 4 ++-- common/djangoapps/student/views/management.py | 6 +++--- common/djangoapps/third_party_auth/pipeline.py | 6 +++--- lms/envs/common.py | 10 +++++----- lms/envs/devstack.py | 4 ++-- lms/envs/devstack_decentralized.py | 2 +- lms/envs/test.py | 4 ++-- lms/templates/header/navbar-not-authenticated.html | 12 ++++++------ openedx/core/djangoapps/user_authn/api/urls.py | 2 +- openedx/core/djangoapps/user_authn/api/views.py | 2 +- openedx/core/djangoapps/user_authn/urls_common.py | 4 ++-- openedx/core/djangoapps/user_authn/utils.py | 4 ++-- openedx/core/djangoapps/user_authn/views/login.py | 10 +++++----- .../core/djangoapps/user_authn/views/login_form.py | 8 ++++---- .../djangoapps/user_authn/views/password_reset.py | 4 ++-- .../djangoapps/user_authn/views/tests/test_login.py | 2 +- .../user_authn/views/tests/test_logistration.py | 6 +++--- .../user_authn/views/tests/test_reset_password.py | 8 ++++---- .../templates/header/navbar-not-authenticated.html | 8 ++++---- 20 files changed, 55 insertions(+), 55 deletions(-) diff --git a/common/djangoapps/student/forms.py b/common/djangoapps/student/forms.py index 91957b81392..0c251d3f267 100644 --- a/common/djangoapps/student/forms.py +++ b/common/djangoapps/student/forms.py @@ -22,7 +22,7 @@ from openedx.core.djangoapps.site_configuration import helpers as configuration_ from openedx.core.djangoapps.theming.helpers import get_current_site from openedx.core.djangoapps.user_api import accounts as accounts_settings from openedx.core.djangoapps.user_api.accounts.utils import is_secondary_email_feature_enabled -from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistration_mircrofrontend +from openedx.core.djangoapps.user_authn.utils import should_redirect_to_authn_microfrontend from openedx.core.djangoapps.user_api.preferences.api import get_user_preference from common.djangoapps.student.message_types import AccountRecovery as AccountRecoveryMessage from common.djangoapps.student.models import CourseEnrollmentAllowed, email_exists_or_retired @@ -39,7 +39,7 @@ def send_account_recovery_email_for_user(user, request, email=None): """ site = get_current_site() message_context = get_base_template_context(site) - site_name = settings.LOGISTRATION_MICROFRONTEND_DOMAIN if should_redirect_to_logistration_mircrofrontend() \ + site_name = settings.AUTHN_MICROFRONTEND_DOMAIN if should_redirect_to_authn_microfrontend() \ else configuration_helpers.get_value('SITE_NAME', settings.SITE_NAME) message_context.update({ 'request': request, # Used by google_analytics_tracking_pixel diff --git a/common/djangoapps/student/tests/test_activate_account.py b/common/djangoapps/student/tests/test_activate_account.py index dbee6142e4e..c6b794e88af 100644 --- a/common/djangoapps/student/tests/test_activate_account.py +++ b/common/djangoapps/student/tests/test_activate_account.py @@ -16,7 +16,7 @@ from common.djangoapps.student.tests.factories import UserFactory FEATURES_WITH_LOGIN_MFE_ENABLED = settings.FEATURES.copy() -FEATURES_WITH_LOGIN_MFE_ENABLED['ENABLE_LOGISTRATION_MICROFRONTEND'] = True +FEATURES_WITH_LOGIN_MFE_ENABLED['ENABLE_AUTHN_MICROFRONTEND'] = True @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') @@ -158,7 +158,7 @@ class TestActivateAccount(TestCase): login page with correct query param. """ login_page_url = "{authn_mfe}/login?account_activation_status=".format( - authn_mfe=settings.LOGISTRATION_MICROFRONTEND_URL + authn_mfe=settings.AUTHN_MICROFRONTEND_URL ) self._assert_user_active_state(expected_active_state=False) diff --git a/common/djangoapps/student/views/management.py b/common/djangoapps/student/views/management.py index d69a4a268a6..a5c58b81fb7 100644 --- a/common/djangoapps/student/views/management.py +++ b/common/djangoapps/student/views/management.py @@ -50,7 +50,7 @@ from openedx.core.djangoapps.programs.models import ProgramsApiConfig from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers from openedx.core.djangoapps.theming import helpers as theming_helpers from openedx.core.djangoapps.user_api.preferences import api as preferences_api -from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistration_mircrofrontend +from openedx.core.djangoapps.user_authn.utils import should_redirect_to_authn_microfrontend from openedx.core.djangolib.markup import HTML, Text from common.djangoapps.student.helpers import DISABLE_UNENROLL_CERT_STATES, cert_info, generate_activation_email_context from common.djangoapps.student.message_types import AccountActivation, EmailChange, EmailChangeConfirmation, RecoveryEmailCreate @@ -547,9 +547,9 @@ def activate_account(request, key): extra_tags='account-activation aa-icon', ) - if should_redirect_to_logistration_mircrofrontend() and not request.user.is_authenticated: + if should_redirect_to_authn_microfrontend() and not request.user.is_authenticated: url_path = '/login?account_activation_status={}'.format(activation_message_type) - return redirect(settings.LOGISTRATION_MICROFRONTEND_URL + url_path) + return redirect(settings.AUTHN_MICROFRONTEND_URL + url_path) return redirect('dashboard') diff --git a/common/djangoapps/third_party_auth/pipeline.py b/common/djangoapps/third_party_auth/pipeline.py index 1ee706be936..16dd6af771c 100644 --- a/common/djangoapps/third_party_auth/pipeline.py +++ b/common/djangoapps/third_party_auth/pipeline.py @@ -88,7 +88,7 @@ from lms.djangoapps.verify_student.utils import earliest_allowed_verification_da from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers from openedx.core.djangoapps.user_api import accounts from openedx.core.djangoapps.user_authn import cookies as user_authn_cookies -from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistration_mircrofrontend +from openedx.core.djangoapps.user_authn.utils import should_redirect_to_authn_microfrontend from common.djangoapps.third_party_auth.utils import user_exists from common.djangoapps.track import segment from common.djangoapps.util.json_request import JsonResponse @@ -129,8 +129,8 @@ AUTH_ENTRY_REGISTER_API = 'register_api' # registration/login form/logic. AUTH_ENTRY_CUSTOM = getattr(settings, 'THIRD_PARTY_AUTH_CUSTOM_AUTH_FORMS', {}) -# If logistration MFE is enabled, the redirect should be to MFE instead of FE -BASE_URL = settings.LOGISTRATION_MICROFRONTEND_URL if should_redirect_to_logistration_mircrofrontend() else '' +# If authn MFE is enabled, the redirect should be to MFE instead of FE +BASE_URL = settings.AUTHN_MICROFRONTEND_URL if should_redirect_to_authn_microfrontend() else '' def is_api(auth_entry): diff --git a/lms/envs/common.py b/lms/envs/common.py index 16866bfa8fe..f5a485b079c 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -643,7 +643,7 @@ FEATURES = { # rollout. 'ENABLE_COURSEWARE_MICROFRONTEND': False, - # .. toggle_name: FEATURES['ENABLE_LOGISTRATION_MICROFRONTEND'] + # .. toggle_name: FEATURES['ENABLE_AUTHN_MICROFRONTEND'] # .. toggle_implementation: DjangoSetting # .. toggle_default: False # .. toggle_description: Supports staged rollout of a new micro-frontend-based implementation of the logistration. @@ -651,9 +651,9 @@ FEATURES = { # .. toggle_creation_date: 2020-09-08 # .. toggle_target_removal_date: None # .. toggle_tickets: 'https://github.com/edx/edx-platform/pull/24908' - # .. toggle_warnings: Also set settings.LOGISTRATION_MICROFRONTEND_URL for rollout. This temporary feature + # .. toggle_warnings: Also set settings.AUTHN_MICROFRONTEND_URL for rollout. This temporary feature # toggle does not have a target removal date. - 'ENABLE_LOGISTRATION_MICROFRONTEND': False, + 'ENABLE_AUTHN_MICROFRONTEND': False, ### ORA Feature Flags ### # .. toggle_name: FEATURES['ENABLE_ORA_ALL_FILE_URLS'] @@ -4090,8 +4090,8 @@ WRITABLE_GRADEBOOK_URL = None PROFILE_MICROFRONTEND_URL = None ORDER_HISTORY_MICROFRONTEND_URL = None ACCOUNT_MICROFRONTEND_URL = None -LOGISTRATION_MICROFRONTEND_URL = None -LOGISTRATION_MICROFRONTEND_DOMAIN = None +AUTHN_MICROFRONTEND_URL = None +AUTHN_MICROFRONTEND_DOMAIN = None PROGRAM_CONSOLE_MICROFRONTEND_URL = None LEARNING_MICROFRONTEND_URL = None diff --git a/lms/envs/devstack.py b/lms/envs/devstack.py index 943d76ff0ec..a7bd7f0f980 100644 --- a/lms/envs/devstack.py +++ b/lms/envs/devstack.py @@ -331,8 +331,8 @@ EDXNOTES_CLIENT_NAME = 'edx_notes_api-backend-service' ############## Settings for Microfrontends ######################### LEARNING_MICROFRONTEND_URL = 'http://localhost:2000' ACCOUNT_MICROFRONTEND_URL = 'http://localhost:1997' -LOGISTRATION_MICROFRONTEND_URL = 'http://localhost:1999' -LOGISTRATION_MICROFRONTEND_DOMAIN = 'localhost:1999' +AUTHN_MICROFRONTEND_URL = 'http://localhost:1999' +AUTHN_MICROFRONTEND_DOMAIN = 'localhost:1999' ############## Docker based devstack settings ####################### diff --git a/lms/envs/devstack_decentralized.py b/lms/envs/devstack_decentralized.py index bf9dab9c5fb..a622aeae7fd 100644 --- a/lms/envs/devstack_decentralized.py +++ b/lms/envs/devstack_decentralized.py @@ -269,7 +269,7 @@ EDXNOTES_CLIENT_NAME = 'edx_notes_api-backend-service' ############## Settings for Microfrontends ######################### LEARNING_MICROFRONTEND_URL = 'http://localhost:2000' ACCOUNT_MICROFRONTEND_URL = 'http://localhost:1997' -LOGISTRATION_MICROFRONTEND_URL = 'http://localhost:1999' +AUTHN_MICROFRONTEND_URL = 'http://localhost:1999' ############## Docker based devstack settings ####################### diff --git a/lms/envs/test.py b/lms/envs/test.py index c22875dc02b..02ba591b2e4 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -569,8 +569,8 @@ PDF_RECEIPT_TAX_ID_LABEL = 'Tax ID' PROFILE_MICROFRONTEND_URL = "http://profile-mfe/abc/" ORDER_HISTORY_MICROFRONTEND_URL = "http://order-history-mfe/" ACCOUNT_MICROFRONTEND_URL = "http://account-mfe" -LOGISTRATION_MICROFRONTEND_URL = "http://logistation-mfe" -LOGISTRATION_MICROFRONTEND_DOMAIN = "logistation-mfe" +AUTHN_MICROFRONTEND_URL = "http://authn-mfe" +AUTHN_MICROFRONTEND_DOMAIN = "authn-mfe" LEARNING_MICROFRONTEND_URL = "http://learning-mfe" ########################## limiting dashboard courses ###################### diff --git a/lms/templates/header/navbar-not-authenticated.html b/lms/templates/header/navbar-not-authenticated.html index 84bcafb348e..5a7daf64b35 100644 --- a/lms/templates/header/navbar-not-authenticated.html +++ b/lms/templates/header/navbar-not-authenticated.html @@ -11,7 +11,7 @@ from django.urls import reverse from django.utils.translation import ugettext as _ from six import text_type -from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistration_mircrofrontend +from openedx.core.djangoapps.user_authn.utils import should_redirect_to_authn_microfrontend %> <% @@ -20,7 +20,7 @@ from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistra allows_login = not settings.FEATURES['DISABLE_LOGIN_BUTTON'] and not combined_login_and_register can_discover_courses = settings.FEATURES.get('ENABLE_COURSE_DISCOVERY') allow_public_account_creation = static.get_value('ALLOW_PUBLIC_ACCOUNT_CREATION', settings.FEATURES.get('ALLOW_PUBLIC_ACCOUNT_CREATION')) - should_redirect_to_logistration_mfe = should_redirect_to_logistration_mircrofrontend() + should_redirect_to_authn_mfe = should_redirect_to_authn_microfrontend() %> <nav class="nav-links" aria-label=${_("Supplemental Links")}> <div class="main"> @@ -49,9 +49,9 @@ from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistra <div> % if allows_login: % if allow_public_account_creation: - % if should_redirect_to_logistration_mfe: + % if should_redirect_to_authn_mfe: <div class="mobile-nav-item hidden-mobile nav-item"> - <a class="register-btn btn" href="${settings.LOGISTRATION_MICROFRONTEND_URL}/register${login_query()}">${_("Register")}</a> + <a class="register-btn btn" href="${settings.AUTHN_MICROFRONTEND_URL}/register${login_query()}">${_("Register")}</a> </div> % else: <div class="mobile-nav-item hidden-mobile nav-item"> @@ -59,9 +59,9 @@ from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistra </div> % endif % endif - % if should_redirect_to_logistration_mfe: + % if should_redirect_to_authn_mfe: <div class="mobile-nav-item hidden-mobile nav-item"> - <a class="sign-in-btn btn" href="${settings.LOGISTRATION_MICROFRONTEND_URL}/login${login_query()}">${_("Sign in")}</a> + <a class="sign-in-btn btn" href="${settings.AUTHN_MICROFRONTEND_URL}/login${login_query()}">${_("Sign in")}</a> </div> % else: <div class="mobile-nav-item hidden-mobile nav-item"> diff --git a/openedx/core/djangoapps/user_authn/api/urls.py b/openedx/core/djangoapps/user_authn/api/urls.py index fae8ffd77e5..8e5d9c208f3 100644 --- a/openedx/core/djangoapps/user_authn/api/urls.py +++ b/openedx/core/djangoapps/user_authn/api/urls.py @@ -1,5 +1,5 @@ """ -Logistration API urls +Authn API urls """ from django.conf.urls import url diff --git a/openedx/core/djangoapps/user_authn/api/views.py b/openedx/core/djangoapps/user_authn/api/views.py index d1d9e5c5f67..75954dc601c 100644 --- a/openedx/core/djangoapps/user_authn/api/views.py +++ b/openedx/core/djangoapps/user_authn/api/views.py @@ -1,5 +1,5 @@ """ -Logistration API Views +Authn API Views """ from django.conf import settings diff --git a/openedx/core/djangoapps/user_authn/urls_common.py b/openedx/core/djangoapps/user_authn/urls_common.py index c387422e4a3..966420b9725 100644 --- a/openedx/core/djangoapps/user_authn/urls_common.py +++ b/openedx/core/djangoapps/user_authn/urls_common.py @@ -86,7 +86,7 @@ urlpatterns = [ ), url(r'^account/password$', password_reset.password_change_request_handler, name='password_change_request'), - # logistration MFE flow + # authn MFE flow url( r'^api/user/v1/account/password_reset/token/validate/$', password_reset.PasswordResetTokenValidation.as_view(), @@ -96,7 +96,7 @@ urlpatterns = [ url(r'^user_api/v1/account/password_reset/token/validate/$', password_reset.PasswordResetTokenValidation.as_view(), name="user_api_password_reset_token_validate_legacy"), - # logistration MFE reset flow + # authn MFE reset flow url( r'^password/reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', password_reset.LogistrationPasswordResetView.as_view(), diff --git a/openedx/core/djangoapps/user_authn/utils.py b/openedx/core/djangoapps/user_authn/utils.py index 693635d85a6..67be03dfa86 100644 --- a/openedx/core/djangoapps/user_authn/utils.py +++ b/openedx/core/djangoapps/user_authn/utils.py @@ -70,10 +70,10 @@ def is_registration_api_v1(request): return 'v1' in request.get_full_path() and 'register' not in request.get_full_path() -def should_redirect_to_logistration_mircrofrontend(): +def should_redirect_to_authn_microfrontend(): """ Checks if login/registration should be done via MFE. """ return configuration_helpers.get_value( - 'ENABLE_LOGISTRATION_MICROFRONTEND', settings.FEATURES.get('ENABLE_LOGISTRATION_MICROFRONTEND') + 'ENABLE_AUTHN_MICROFRONTEND', settings.FEATURES.get('ENABLE_AUTHN_MICROFRONTEND') ) diff --git a/openedx/core/djangoapps/user_authn/views/login.py b/openedx/core/djangoapps/user_authn/views/login.py index 9d4041a23df..7c9294ba5fe 100644 --- a/openedx/core/djangoapps/user_authn/views/login.py +++ b/openedx/core/djangoapps/user_authn/views/login.py @@ -33,7 +33,7 @@ from openedx.core.djangoapps.site_configuration import helpers as configuration_ from openedx.core.djangoapps.user_authn.views.login_form import get_login_session_form from openedx.core.djangoapps.user_authn.cookies import get_response_with_refreshed_jwt_cookies, set_logged_in_cookies from openedx.core.djangoapps.user_authn.exceptions import AuthFailedError -from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistration_mircrofrontend +from openedx.core.djangoapps.user_authn.utils import should_redirect_to_authn_microfrontend from openedx.core.djangoapps.util.user_messages import PageLevelMessages from openedx.core.djangoapps.user_authn.views.password_reset import send_password_reset_email_for_user from openedx.core.djangoapps.user_authn.toggles import is_require_third_party_auth_enabled @@ -125,7 +125,7 @@ def _generate_locked_out_error_message(): """ locked_out_period_in_sec = settings.MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS - if not should_redirect_to_logistration_mircrofrontend: # pylint: disable=no-else-raise + if not should_redirect_to_authn_microfrontend: # pylint: disable=no-else-raise raise AuthFailedError(Text(_('To protect your account, it’s been temporarily ' 'locked. Try again in {locked_out_period} minutes.' '{li_start}To be on the safe side, you can reset your ' @@ -238,7 +238,7 @@ def _handle_failed_authentication(user, authenticated_user): if not LoginFailures.is_user_locked_out(user): max_failures_allowed = settings.MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED remaining_attempts = max_failures_allowed - failure_count - if not should_redirect_to_logistration_mircrofrontend: # pylint: disable=no-else-raise + if not should_redirect_to_authn_microfrontend: # pylint: disable=no-else-raise raise AuthFailedError(Text(_('Email or password is incorrect.' '{li_start}You have {remaining_attempts} more sign-in ' 'attempts before your account is temporarily locked.{li_end}' @@ -363,7 +363,7 @@ def _check_user_auth_flow(site, user): # If user belongs to allowed domain and not whitelisted then user must login through allowed domain SSO if user_domain == allowed_domain and not AllowedAuthUser.objects.filter(site=site, email=user.email).exists(): - if not should_redirect_to_logistration_mircrofrontend(): + if not should_redirect_to_authn_microfrontend(): msg = _create_message(site, None, allowed_domain) else: root_url = configuration_helpers.get_value('LMS_ROOT_URL', settings.LMS_ROOT_URL) @@ -501,7 +501,7 @@ def login_user(request): running_pipeline = pipeline.get(request) redirect_url = pipeline.get_complete_url(backend_name=running_pipeline['backend']) - elif should_redirect_to_logistration_mircrofrontend(): + elif should_redirect_to_authn_microfrontend(): redirect_url = get_next_url_for_login_page(request, include_host=True) response = JsonResponse({ diff --git a/openedx/core/djangoapps/user_authn/views/login_form.py b/openedx/core/djangoapps/user_authn/views/login_form.py index d116314444d..5bfd6d0f820 100644 --- a/openedx/core/djangoapps/user_authn/views/login_form.py +++ b/openedx/core/djangoapps/user_authn/views/login_form.py @@ -24,7 +24,7 @@ from openedx.core.djangoapps.user_api.accounts.utils import ( ) from openedx.core.djangoapps.user_api.helpers import FormDescription from openedx.core.djangoapps.user_authn.cookies import are_logged_in_cookies_set -from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistration_mircrofrontend +from openedx.core.djangoapps.user_authn.utils import should_redirect_to_authn_microfrontend from openedx.core.djangoapps.user_authn.views.password_reset import get_password_reset_form from openedx.core.djangoapps.user_authn.views.registration_form import RegistrationFormFactory from openedx.core.djangoapps.user_authn.views.utils import third_party_auth_context @@ -185,14 +185,14 @@ def login_and_registration_form(request, initial_mode="login"): log.exception(u"Unknown tpa_hint provider: %s", ex) enterprise_customer = enterprise_customer_for_request(request) - # Redirect to logistration MFE if it is enabled - if should_redirect_to_logistration_mircrofrontend() and not enterprise_customer: + # Redirect to authn MFE if it is enabled + if should_redirect_to_authn_microfrontend() and not enterprise_customer: query_params = request.GET.urlencode() url_path = '/{}{}'.format( initial_mode, '?' + query_params if query_params else '' ) - return redirect(settings.LOGISTRATION_MICROFRONTEND_URL + url_path) + return redirect(settings.AUTHN_MICROFRONTEND_URL + url_path) # Account activation message account_activation_messages = [ diff --git a/openedx/core/djangoapps/user_authn/views/password_reset.py b/openedx/core/djangoapps/user_authn/views/password_reset.py index 648df84f4f8..0497bd8def5 100644 --- a/openedx/core/djangoapps/user_authn/views/password_reset.py +++ b/openedx/core/djangoapps/user_authn/views/password_reset.py @@ -35,7 +35,7 @@ from openedx.core.djangoapps.oauth_dispatch.api import destroy_oauth_tokens from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers from openedx.core.djangoapps.theming.helpers import get_current_request, get_current_site from openedx.core.djangoapps.user_api import accounts, errors, helpers -from openedx.core.djangoapps.user_authn.utils import should_redirect_to_logistration_mircrofrontend +from openedx.core.djangoapps.user_authn.utils import should_redirect_to_authn_microfrontend from openedx.core.djangoapps.user_api.accounts.utils import is_secondary_email_feature_enabled from openedx.core.djangoapps.user_api.helpers import FormDescription from openedx.core.djangoapps.user_api.models import UserRetirementRequest @@ -147,7 +147,7 @@ def send_password_reset_email_for_user(user, request, preferred_email=None): preferred_email (str): Send email to this address if present, otherwise fallback to user's email address. """ message_context, user_language_preference = get_user_default_email_params(user) - site_name = settings.LOGISTRATION_MICROFRONTEND_DOMAIN if should_redirect_to_logistration_mircrofrontend() \ + site_name = settings.AUTHN_MICROFRONTEND_DOMAIN if should_redirect_to_authn_microfrontend() \ else configuration_helpers.get_value('SITE_NAME', settings.SITE_NAME) message_context.update({ 'request': request, # Used by google_analytics_tracking_pixel diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_login.py b/openedx/core/djangoapps/user_authn/views/tests/test_login.py index c1bd99b4639..609495744f7 100644 --- a/openedx/core/djangoapps/user_authn/views/tests/test_login.py +++ b/openedx/core/djangoapps/user_authn/views/tests/test_login.py @@ -80,7 +80,7 @@ class LoginTest(SiteMixin, CacheIsolationTestCase): self._assert_audit_log(mock_audit_log, 'info', [u'Login success', self.user_email]) FEATURES_WITH_LOGIN_MFE_ENABLED = settings.FEATURES.copy() - FEATURES_WITH_LOGIN_MFE_ENABLED['ENABLE_LOGISTRATION_MICROFRONTEND'] = True + FEATURES_WITH_LOGIN_MFE_ENABLED['ENABLE_AUTHN_MICROFRONTEND'] = True @patch.dict(settings.FEATURES, { "ENABLE_THIRD_PARTY_AUTH": True diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_logistration.py b/openedx/core/djangoapps/user_authn/views/tests/test_logistration.py index 608281b8a35..ca320ca25e0 100644 --- a/openedx/core/djangoapps/user_authn/views/tests/test_logistration.py +++ b/openedx/core/djangoapps/user_authn/views/tests/test_logistration.py @@ -65,7 +65,7 @@ class LoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMixin, ModuleSto self.hidden_disabled_provider = self.configure_azure_ad_provider() FEATURES_WITH_LOGIN_MFE_ENABLED = settings.FEATURES.copy() - FEATURES_WITH_LOGIN_MFE_ENABLED['ENABLE_LOGISTRATION_MICROFRONTEND'] = True + FEATURES_WITH_LOGIN_MFE_ENABLED['ENABLE_AUTHN_MICROFRONTEND'] = True @ddt.data( ("signin_user", "/login"), @@ -81,7 +81,7 @@ class LoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMixin, ModuleSto """ response = self.client.get(reverse(url_name)) - self.assertEqual(response.url, settings.LOGISTRATION_MICROFRONTEND_URL + path) + self.assertEqual(response.url, settings.AUTHN_MICROFRONTEND_URL + path) self.assertEqual(response.status_code, 302) @ddt.data( @@ -103,7 +103,7 @@ class LoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMixin, ModuleSto Test that if request is redirected to logistration MFE, query params are passed to the redirect url. """ - expected_url = settings.LOGISTRATION_MICROFRONTEND_URL + path + '?' + urlencode(query_params) + expected_url = settings.AUTHN_MICROFRONTEND_URL + path + '?' + urlencode(query_params) response = self.client.get(reverse(url_name), query_params) self.assertRedirects(response, expected_url, target_status_code=302) diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py b/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py index c3fd6e2e352..fdc2bf3614f 100644 --- a/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py +++ b/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py @@ -46,8 +46,8 @@ from common.djangoapps.util.password_policy_validators import create_validator_c from common.djangoapps.util.testing import EventTestMixin -ENABLE_LOGISTRATION_MICROFRONTEND = settings.FEATURES.copy() -ENABLE_LOGISTRATION_MICROFRONTEND['ENABLE_LOGISTRATION_MICROFRONTEND'] = True +ENABLE_AUTHN_MICROFRONTEND = settings.FEATURES.copy() +ENABLE_AUTHN_MICROFRONTEND['ENABLE_AUTHN_MICROFRONTEND'] = True def process_request(request): @@ -330,7 +330,7 @@ class ResetPasswordTests(EventTestMixin, CacheIsolationTestCase): SETTING_CHANGE_INITIATED, user_id=self.user.id, setting=u'password', old=None, new=None ) - @override_settings(FEATURES=ENABLE_LOGISTRATION_MICROFRONTEND) + @override_settings(FEATURES=ENABLE_AUTHN_MICROFRONTEND) @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', "Test only valid in LMS") @ddt.data(('Crazy Awesome Site', 'Crazy Awesome Site'), ('edX', 'edX')) @ddt.unpack @@ -354,7 +354,7 @@ class ResetPasswordTests(EventTestMixin, CacheIsolationTestCase): reset_msg = reset_msg.format(site_name) self.assertIn(reset_msg, msg) - self.assertIn(settings.LOGISTRATION_MICROFRONTEND_URL, msg) + self.assertIn(settings.AUTHN_MICROFRONTEND_URL, msg) sign_off = u"The {} Team".format(platform_name) self.assertIn(sign_off, msg) diff --git a/themes/edx.org/lms/templates/header/navbar-not-authenticated.html b/themes/edx.org/lms/templates/header/navbar-not-authenticated.html index ae8b0ff27eb..0ada07e05d7 100644 --- a/themes/edx.org/lms/templates/header/navbar-not-authenticated.html +++ b/themes/edx.org/lms/templates/header/navbar-not-authenticated.html @@ -21,9 +21,9 @@ from six import text_type <div> % if allows_login: % if allow_public_account_creation: - % if should_redirect_to_logistration_mfe: + % if should_redirect_to_authn_mfe: <div class="mobile-nav-item hidden-mobile nav-item"> - <a class="register-btn btn" href="${settings.LOGISTRATION_MICROFRONTEND_URL}/register${login_query()}">${_("Register")}</a> + <a class="register-btn btn" href="${settings.AUTHN_MICROFRONTEND_URL}/register${login_query()}">${_("Register")}</a> </div> % else: <div class="mobile-nav-item hidden-mobile nav-item"> @@ -31,9 +31,9 @@ from six import text_type </div> % endif % endif - % if should_redirect_to_logistration_mfe: + % if should_redirect_to_authn_mfe: <div class="mobile-nav-item hidden-mobile nav-item"> - <a class="sign-in-btn btn" href="${settings.LOGISTRATION_MICROFRONTEND_URL}/login${login_query()}">${_("Sign in")}</a> + <a class="sign-in-btn btn" href="${settings.AUTHN_MICROFRONTEND_URL}/login${login_query()}">${_("Sign in")}</a> </div> % else: <div class="mobile-nav-item hidden-mobile nav-item"> -- GitLab