From 5d02a14bb17759445b07131ed84896d7c8869c6d Mon Sep 17 00:00:00 2001 From: Joe Badaczewski Date: Wed, 2 Dec 2020 13:50:05 -0500 Subject: [PATCH] Adding defaults for open-oidc fields --- backend/models/proxy_host.js | 25 +++++++++++++++++++++++++ frontend/js/app/nginx/proxy/form.js | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/backend/models/proxy_host.js b/backend/models/proxy_host.js index 30d4c73b..485f6939 100644 --- a/backend/models/proxy_host.js +++ b/backend/models/proxy_host.js @@ -20,6 +20,31 @@ class ProxyHost extends Model { this.domain_names = []; } + // Default for openidc_discovery + if (typeof this.openidc_discovery === 'undefined') { + this.openidc_discovery = ''; + } + + // Default for openidc_client_id + if (typeof this.openidc_client_id === 'undefined') { + this.openidc_client_id = ''; + } + + // Default for openidc_client_secret + if (typeof this.openidc_client_secret === 'undefined') { + this.openidc_client_secret = ''; + } + + // Default for openidc_discovery + if (typeof this.openidc_discovery === 'undefined') { + this.openidc_discovery = ''; + } + + // Default for openidc_redirect_uri + if (typeof this.openidc_redirect_uri === 'undefined') { + this.openidc_redirect_uri = ''; + } + // Default for openidc_allowed_users if (typeof this.openidc_allowed_users === 'undefined') { this.openidc_allowed_users = []; diff --git a/frontend/js/app/nginx/proxy/form.js b/frontend/js/app/nginx/proxy/form.js index 1e57afa8..666a8a6c 100644 --- a/frontend/js/app/nginx/proxy/form.js +++ b/frontend/js/app/nginx/proxy/form.js @@ -43,8 +43,8 @@ module.exports = Mn.View.extend({ dns_provider_credentials: 'textarea[name="meta[dns_provider_credentials]"]', propagation_seconds: 'input[name="meta[propagation_seconds]"]', forward_scheme: 'select[name="forward_scheme"]', - letsencrypt: '.letsencrypt' - openidc_users: '.openidc_users' + letsencrypt: '.letsencrypt', + openidc_users: '.openidc_users', openidc: '.openidc', openidc_allowed_users: 'input[name="openidc_allowed_users"]', openidc_restrict_users_enabled: 'input[name="openidc_restrict_users_enabled"]',