Addressing feedback
This commit is contained in:
@@ -439,6 +439,9 @@ LMS_INTERNAL_ROOT_URL = LMS_ROOT_URL
|
||||
LMS_ENROLLMENT_API_PATH = "/api/enrollment/v1/"
|
||||
ENTERPRISE_API_URL = LMS_INTERNAL_ROOT_URL + '/enterprise/api/v1/'
|
||||
ENTERPRISE_CONSENT_API_URL = LMS_INTERNAL_ROOT_URL + '/consent/api/v1/'
|
||||
FRONTEND_LOGIN_URL = LOGIN_URL
|
||||
FRONTEND_LOGOUT_URL = lambda settings: settings.LMS_ROOT_URL + '/logout'
|
||||
derived('FRONTEND_LOGOUT_URL')
|
||||
|
||||
# List of logout URIs for each IDA that the learner should be logged out of when they logout of
|
||||
# Studio. Only applies to IDA for which the social auth flow uses DOT (Django OAuth Toolkit).
|
||||
|
||||
@@ -13,6 +13,7 @@ import yaml
|
||||
from path import Path as path
|
||||
from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed
|
||||
from openedx.core.djangoapps.plugins import plugin_settings, constants as plugin_constants
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
|
||||
from .common import *
|
||||
@@ -298,9 +299,14 @@ HEARTBEAT_CHECKS = ENV_TOKENS.get('HEARTBEAT_CHECKS', HEARTBEAT_CHECKS)
|
||||
HEARTBEAT_EXTENDED_CHECKS = ENV_TOKENS.get('HEARTBEAT_EXTENDED_CHECKS', HEARTBEAT_EXTENDED_CHECKS)
|
||||
HEARTBEAT_CELERY_TIMEOUT = ENV_TOKENS.get('HEARTBEAT_CELERY_TIMEOUT', HEARTBEAT_CELERY_TIMEOUT)
|
||||
|
||||
# Login using the LMS as the identity provider
|
||||
# Login using the LMS as the identity provider.
|
||||
# Turning the flag to True means that the LMS will NOT be used as the Identity Provider (idp)
|
||||
if FEATURES.get('DISABLE_STUDIO_SSO_OVER_LMS', False):
|
||||
LOGIN_URL = EDX_ROOT_URL + '/signin'
|
||||
LOGIN_URL = reverse_lazy('login')
|
||||
FRONTEND_LOGIN_URL = LOGIN_URL
|
||||
FRONTEND_LOGOUT_URL = reverse_lazy('logout')
|
||||
|
||||
LOGIN_REDIRECT_WHITELIST = [reverse_lazy('home')]
|
||||
|
||||
# Specific setting for the File Upload Service to store media in a bucket.
|
||||
FILE_UPLOAD_STORAGE_BUCKET_NAME = ENV_TOKENS.get('FILE_UPLOAD_STORAGE_BUCKET_NAME', FILE_UPLOAD_STORAGE_BUCKET_NAME)
|
||||
|
||||
@@ -231,14 +231,6 @@
|
||||
% else:
|
||||
<%
|
||||
register_url = settings.LMS_ROOT_URL + '/register'
|
||||
|
||||
if settings.FEATURES.get('DISABLE_STUDIO_SSO_OVER_LMS', False):
|
||||
login_url = settings.LOGIN_URL
|
||||
else:
|
||||
login_url = '{lms_root_url}/login?next={next_url}'.format(
|
||||
lms_root_url=settings.LMS_ROOT_URL,
|
||||
next_url=current_url,
|
||||
)
|
||||
%>
|
||||
<nav class="nav-not-signedin nav-pitch" aria-label="${_('Account')}">
|
||||
<h2 class="sr-only">${_("Account Navigation")}</h2>
|
||||
@@ -252,7 +244,7 @@
|
||||
</li>
|
||||
% endif
|
||||
<li class="nav-item nav-not-signedin-signin">
|
||||
<a class="action action-signin" href="${login_url}">${_("Sign In")}</a>
|
||||
<a class="action action-signin" href="${settings.FRONTEND_LOGIN_URL}?next=${current_url}">${_("Sign In")}</a>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
@@ -39,15 +39,6 @@
|
||||
</span>
|
||||
<span class="icon fa fa-caret-down ui-toggle-dd" aria-hidden="true"></span>
|
||||
</h3>
|
||||
<%
|
||||
if settings.FEATURES.get('DISABLE_STUDIO_SSO_OVER_LMS', False):
|
||||
logout_url = reverse('logout')
|
||||
else:
|
||||
logout_url = '{lms_root_url}/logout?next={next_url}'.format(
|
||||
lms_root_url=settings.LMS_ROOT_URL,
|
||||
next_url=current_site_url,
|
||||
)
|
||||
%>
|
||||
<div class="wrapper wrapper-nav-sub">
|
||||
<div class="nav-sub">
|
||||
<ul>
|
||||
@@ -60,7 +51,7 @@
|
||||
</li>
|
||||
% endif
|
||||
<li class="nav-item nav-account-signout">
|
||||
<a class="action action-signout" href="${logout_url}">${_("Sign Out")}</a>
|
||||
<a class="action action-signout" href="${settings.FRONTEND_LOGOUT_URL}">${_("Sign Out")}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -57,7 +57,11 @@ class LogoutView(TemplateView):
|
||||
|
||||
logout(request)
|
||||
|
||||
response = super(LogoutView, self).dispatch(request, *args, **kwargs)
|
||||
# If we don't need to deal with OIDC logouts, just redirect the user.
|
||||
if self.oauth_client_ids:
|
||||
response = super(LogoutView, self).dispatch(request, *args, **kwargs)
|
||||
else:
|
||||
response = redirect(self.target)
|
||||
|
||||
# Clear the cookie used by the edx.org marketing site
|
||||
delete_logged_in_cookies(response)
|
||||
|
||||
Reference in New Issue
Block a user