Skip to content

Commit

Permalink
FIx hiding of fields in authorization source page (#10734) (#10752)
Browse files Browse the repository at this point in the history
  • Loading branch information
lafriks authored Mar 19, 2020
1 parent c0b917b commit e2da9cd
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions web_src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1886,18 +1886,11 @@ function initAdmin() {
$('.oauth2_use_custom_url_field input[required]').removeAttr('required');

if ($('#oauth2_use_custom_url').is(':checked')) {
if (!$('#oauth2_token_url').val()) {
$('#oauth2_token_url').val($(`#${provider}_token_url`).val());
}
if (!$('#oauth2_auth_url').val()) {
$('#oauth2_auth_url').val($(`#${provider}_auth_url`).val());
}
if (!$('#oauth2_profile_url').val()) {
$('#oauth2_profile_url').val($(`#${provider}_profile_url`).val());
}
if (!$('#oauth2_email_url').val()) {
$('#oauth2_email_url').val($(`#${provider}_email_url`).val());
}
$('#oauth2_token_url').val($(`#${provider}_token_url`).val());
$('#oauth2_auth_url').val($(`#${provider}_auth_url`).val());
$('#oauth2_profile_url').val($(`#${provider}_profile_url`).val());
$('#oauth2_email_url').val($(`#${provider}_email_url`).val());

switch (provider) {
case 'github':
$('.oauth2_token_url input, .oauth2_auth_url input, .oauth2_profile_url input, .oauth2_email_url input').attr('required', 'required');
Expand All @@ -1916,7 +1909,7 @@ function initAdmin() {
// New authentication
if ($('.admin.new.authentication').length > 0) {
$('#auth_type').change(function () {
$('.ldap, .dldap, .smtp, .pam, .oauth2, .has-tls .search-page-size .sspi').hide();
$('.ldap, .dldap, .smtp, .pam, .oauth2, .has-tls, .search-page-size, .sspi').hide();

$('.ldap input[required], .binddnrequired input[required], .dldap input[required], .smtp input[required], .pam input[required], .oauth2 input[required], .has-tls input[required], .sspi input[required]').removeAttr('required');
$('.binddnrequired').removeClass('required');
Expand Down

0 comments on commit e2da9cd

Please sign in to comment.