diff options
author | Lauris BH <lauris@nix.lv> | 2020-03-19 17:40:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-19 11:40:01 -0400 |
commit | e2da9cd21f0d87696b9b72d8fb704f897e1920e7 (patch) | |
tree | e42ade4a864e055da8a67648b7c3e9a727ebd2f6 | |
parent | c0b917b7eb964377e5ae1f6916aaeb72008eb0a3 (diff) | |
download | gitea-e2da9cd21f0d87696b9b72d8fb704f897e1920e7.tar.gz gitea-e2da9cd21f0d87696b9b72d8fb704f897e1920e7.zip |
FIx hiding of fields in authorization source page (#10734) (#10752)
-rw-r--r-- | web_src/js/index.js | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js index 30e8257b09..027e5a89c1 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -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'); @@ -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'); |