Skip to content

Commit ca18110

Browse files
authored
FIx hiding of fields in authorization source page (#10734)
1 parent 10e8da1 commit ca18110

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

web_src/js/index.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,18 +1893,11 @@ function initAdmin() {
18931893
$('.oauth2_use_custom_url_field input[required]').removeAttr('required');
18941894

18951895
if ($('#oauth2_use_custom_url').is(':checked')) {
1896-
if (!$('#oauth2_token_url').val()) {
1897-
$('#oauth2_token_url').val($(`#${provider}_token_url`).val());
1898-
}
1899-
if (!$('#oauth2_auth_url').val()) {
1900-
$('#oauth2_auth_url').val($(`#${provider}_auth_url`).val());
1901-
}
1902-
if (!$('#oauth2_profile_url').val()) {
1903-
$('#oauth2_profile_url').val($(`#${provider}_profile_url`).val());
1904-
}
1905-
if (!$('#oauth2_email_url').val()) {
1906-
$('#oauth2_email_url').val($(`#${provider}_email_url`).val());
1907-
}
1896+
$('#oauth2_token_url').val($(`#${provider}_token_url`).val());
1897+
$('#oauth2_auth_url').val($(`#${provider}_auth_url`).val());
1898+
$('#oauth2_profile_url').val($(`#${provider}_profile_url`).val());
1899+
$('#oauth2_email_url').val($(`#${provider}_email_url`).val());
1900+
19081901
switch (provider) {
19091902
case 'github':
19101903
$('.oauth2_token_url input, .oauth2_auth_url input, .oauth2_profile_url input, .oauth2_email_url input').attr('required', 'required');
@@ -1924,7 +1917,7 @@ function initAdmin() {
19241917
// New authentication
19251918
if ($('.admin.new.authentication').length > 0) {
19261919
$('#auth_type').change(function () {
1927-
$('.ldap, .dldap, .smtp, .pam, .oauth2, .has-tls .search-page-size .sspi').hide();
1920+
$('.ldap, .dldap, .smtp, .pam, .oauth2, .has-tls, .search-page-size, .sspi').hide();
19281921

19291922
$('.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');
19301923
$('.binddnrequired').removeClass('required');

0 commit comments

Comments
 (0)