Skip to content

Commit

Permalink
fix: let the platform decide to how login the users
Browse files Browse the repository at this point in the history
We force users to go to authentication mfe for login/registration and prevent the login behaviour tweaks l
ike having THIRD_PARTY_AUTH_HINT in your site configuration which redirect users to a TPA when they visit /login.
  • Loading branch information
CodeWithEmad committed Jun 14, 2024
1 parent 8d68dd3 commit 99234eb
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions lms/templates/header/navbar-not-authenticated.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
from django.conf import settings
from django.urls import reverse
from django.utils.translation import gettext as _

from openedx.core.djangoapps.user_authn.toggles import should_redirect_to_authn_microfrontend
%>

<%
Expand All @@ -19,7 +17,6 @@
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')) and settings.FEATURES.get('SHOW_REGISTRATION_LINKS', True)
should_redirect_to_authn_mfe = should_redirect_to_authn_microfrontend()
%>
<nav class="nav-links" aria-label=${_("Supplemental Links")}>
<div class="main">
Expand Down Expand Up @@ -48,25 +45,13 @@
<div>
% if allows_login:
% if allow_public_account_creation and not disable_register_button:
% if should_redirect_to_authn_mfe:
<div class="mobile-nav-item hidden-mobile nav-item">
<a class="register-btn btn" href="${settings.AUTHN_MICROFRONTEND_URL}/register${login_query()}">${_("Register for free")}</a>
</div>
% else:
<div class="mobile-nav-item hidden-mobile nav-item">
<a class="register-btn btn" href="/register${login_query()}">${_("Register for free")}</a>
</div>
% endif
% endif
% if should_redirect_to_authn_mfe:
<div class="mobile-nav-item hidden-mobile nav-item">
<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">
<a class="sign-in-btn btn" href="/login${login_query()}">${_("Sign in")}</a>
<a class="register-btn btn" href="/register${login_query()}">${_("Register for free")}</a>
</div>
% endif
<div class="mobile-nav-item hidden-mobile nav-item">
<a class="sign-in-btn btn" href="/login${login_query()}">${_("Sign in")}</a>
</div>
% endif
</div>
</div>
Expand Down

0 comments on commit 99234eb

Please sign in to comment.