Commit cc460bbb by Brittney Exline Committed by GitHub

Merge pull request #15391 from edx/bexline/ent_authentication_flow

ENT-447 Add ability to hide auth warnings for enterprise context.
parents 4766d18a 611af39d
...@@ -220,6 +220,7 @@ def update_context_for_enterprise(request, context): ...@@ -220,6 +220,7 @@ def update_context_for_enterprise(request, context):
) )
context.update(sidebar_context) context.update(sidebar_context)
context['enable_enterprise_sidebar'] = True context['enable_enterprise_sidebar'] = True
context['data']['hide_auth_warnings'] = True
else: else:
context['enable_enterprise_sidebar'] = False context['enable_enterprise_sidebar'] = False
......
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
this.supportURL = options.support_link; this.supportURL = options.support_link;
this.passwordResetSupportUrl = options.password_reset_support_link; this.passwordResetSupportUrl = options.password_reset_support_link;
this.createAccountOption = options.account_creation_allowed; this.createAccountOption = options.account_creation_allowed;
this.hideAuthWarnings = options.hide_auth_warnings || false;
// The login view listens for 'sync' events from the reset model // The login view listens for 'sync' events from the reset model
this.resetModel = new PasswordResetModel({}, { this.resetModel = new PasswordResetModel({}, {
...@@ -131,7 +132,8 @@ ...@@ -131,7 +132,8 @@
platformName: this.platformName, platformName: this.platformName,
supportURL: this.supportURL, supportURL: this.supportURL,
passwordResetSupportUrl: this.passwordResetSupportUrl, passwordResetSupportUrl: this.passwordResetSupportUrl,
createAccountOption: this.createAccountOption createAccountOption: this.createAccountOption,
hideAuthWarnings: this.hideAuthWarnings
}); });
// Listen for 'password-help' event to toggle sub-views // Listen for 'password-help' event to toggle sub-views
...@@ -167,7 +169,8 @@ ...@@ -167,7 +169,8 @@
fields: data.fields, fields: data.fields,
model: model, model: model,
thirdPartyAuth: this.thirdPartyAuth, thirdPartyAuth: this.thirdPartyAuth,
platformName: this.platformName platformName: this.platformName,
hideAuthWarnings: this.hideAuthWarnings
}); });
// Listen for 'auth-complete' event so we can enroll/redirect the user appropriately. // Listen for 'auth-complete' event so we can enroll/redirect the user appropriately.
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
this.passwordResetSupportUrl = data.passwordResetSupportUrl; this.passwordResetSupportUrl = data.passwordResetSupportUrl;
this.createAccountOption = data.createAccountOption; this.createAccountOption = data.createAccountOption;
this.accountActivationMessages = data.accountActivationMessages; this.accountActivationMessages = data.accountActivationMessages;
this.hideAuthWarnings = data.hideAuthWarnings;
this.listenTo(this.model, 'sync', this.saveSuccess); this.listenTo(this.model, 'sync', this.saveSuccess);
this.listenTo(this.resetModel, 'sync', this.resetEmail); this.listenTo(this.resetModel, 'sync', this.resetEmail);
...@@ -193,8 +194,10 @@ ...@@ -193,8 +194,10 @@
if (error.status === 403 && if (error.status === 403 &&
error.responseText === 'third-party-auth' && error.responseText === 'third-party-auth' &&
this.currentProvider) { this.currentProvider) {
this.clearFormErrors(); if (!this.hideAuthWarnings) {
this.renderAuthWarning(); this.clearFormErrors();
this.renderAuthWarning();
}
} else { } else {
this.renderErrors(this.defaultFormErrorsTitle, this.errors); this.renderErrors(this.defaultFormErrorsTitle, this.errors);
} }
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
this.errorMessage = data.thirdPartyAuth.errorMessage || ''; this.errorMessage = data.thirdPartyAuth.errorMessage || '';
this.platformName = data.platformName; this.platformName = data.platformName;
this.autoSubmit = data.thirdPartyAuth.autoSubmitRegForm; this.autoSubmit = data.thirdPartyAuth.autoSubmitRegForm;
this.hideAuthWarnings = data.hideAuthWarnings;
this.listenTo(this.model, 'sync', this.saveSuccess); this.listenTo(this.model, 'sync', this.saveSuccess);
}, },
...@@ -63,7 +64,7 @@ ...@@ -63,7 +64,7 @@
// Must be called after postRender, since postRender sets up $formFeedback. // Must be called after postRender, since postRender sets up $formFeedback.
if (this.errorMessage) { if (this.errorMessage) {
this.renderErrors(formErrorsTitle, [this.errorMessage]); this.renderErrors(formErrorsTitle, [this.errorMessage]);
} else if (this.currentProvider) { } else if (this.currentProvider && !this.hideAuthWarnings) {
this.renderAuthWarning(); this.renderAuthWarning();
} }
......
...@@ -52,7 +52,7 @@ edx-lint==0.4.3 ...@@ -52,7 +52,7 @@ edx-lint==0.4.3
astroid==1.3.8 astroid==1.3.8
edx-django-oauth2-provider==1.1.4 edx-django-oauth2-provider==1.1.4
edx-django-sites-extensions==2.1.1 edx-django-sites-extensions==2.1.1
edx-enterprise==0.36.3 edx-enterprise==0.36.5
edx-oauth2-provider==1.2.0 edx-oauth2-provider==1.2.0
edx-opaque-keys==0.4.0 edx-opaque-keys==0.4.0
edx-organizations==0.4.4 edx-organizations==0.4.4
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment