Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion lms/djangoapps/student_account/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,24 @@ def login_and_registration_form(request, initial_mode="login"):
except (KeyError, ValueError, IndexError):
pass

third_party_auth = _third_party_auth_context(request, redirect_to)
if not third_party_auth['currentProvider'] and settings.APPSEMBLER_FEATURES.get('ENABLE_EXCLUSIVE_SSO_LOGISTRATION'):
urls_dict = configuration_helpers.get_value(
'EXCLUSIVE_SSO_LOGISTRATION_URL_MAP',
settings.EXCLUSIVE_SSO_LOGISTRATION_URL_MAP)
if initial_mode == 'register':
if 'register' in urls_dict:
return redirect(urls_dict['register'])
elif initial_mode == 'login':
if 'login' in urls_dict:
return redirect(urls_dict['login'])

# Otherwise, render the combined login/registration page
context = {
'data': {
'login_redirect_url': redirect_to,
'initial_mode': initial_mode,
'third_party_auth': _third_party_auth_context(request, redirect_to),
'third_party_auth': third_party_auth,
'third_party_auth_hint': third_party_auth_hint or '',
'platform_name': configuration_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME),

Expand Down
2 changes: 2 additions & 0 deletions lms/envs/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,3 +870,5 @@
APP_UPGRADE_CACHE_TIMEOUT = ENV_TOKENS.get('APP_UPGRADE_CACHE_TIMEOUT', APP_UPGRADE_CACHE_TIMEOUT)

AFFILIATE_COOKIE_NAME = ENV_TOKENS.get('AFFILIATE_COOKIE_NAME', AFFILIATE_COOKIE_NAME)

EXCLUSIVE_SSO_LOGISTRATION_URL_MAP = ENV_TOKENS.get('EXCLUSIVE_SSO_LOGISTRATION_URL_MAP', {})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@melvinsoft you've used aws.py, but devstack_appsembler.py. Care to unify?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OmarIthawi Thanks, change addressed.

2 changes: 2 additions & 0 deletions lms/envs/devstack_appsembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,5 @@
SP_SAML_RESTRICT_MODE = False

CUSTOM_SSO_FIELDS_SYNC = ENV_TOKENS.get('CUSTOM_SSO_FIELDS_SYNC', {})

EXCLUSIVE_SSO_LOGISTRATION_URL_MAP = ENV_TOKENS.get('EXCLUSIVE_SSO_LOGISTRATION_URL_MAP', {})