summaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2020-03-17 10:12:44 +0200
committerGitHub <noreply@github.com>2020-03-17 10:12:44 +0200
commitca181100ca353bb3541186f7589786f193143800 (patch)
treedb0c5cf74bd40af46722cbce850d3ba9f0127447 /web_src
parent10e8da1f1a43ccfdc12fb4622c49cb01610f2148 (diff)
downloadgitea-ca181100ca353bb3541186f7589786f193143800.tar.gz
gitea-ca181100ca353bb3541186f7589786f193143800.zip
FIx hiding of fields in authorization source page (#10734)
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/index.js19
1 files changed, 6 insertions, 13 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 76e006e51d..455e6cc3ff 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -1893,18 +1893,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');
@@ -1924,7 +1917,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');