diff --git a/ui-v2/config/environment.js b/ui-v2/config/environment.js index f74e2bdfd9..1ee3c85f42 100644 --- a/ui-v2/config/environment.js +++ b/ui-v2/config/environment.js @@ -127,9 +127,11 @@ module.exports = function(environment, $ = process.env) { }); break; case environment === 'production': + // Make sure all templated variables check for existence first + // before outputting them, this means they all should be conditionals ENV = Object.assign({}, ENV, { - CONSUL_ACLS_ENABLED: '{{.ACLsEnabled}}', - CONSUL_SSO_ENABLED: '{{.SSOEnabled}}', + CONSUL_ACLS_ENABLED: '{{ if .ACLsEnabled }}{{.ACLsEnabled}}{{ else }}false{{ end }}', + CONSUL_SSO_ENABLED: '{{ if .SSOEnabled }}{{.SSOEnabled}}{{ else }}false{{ end }}', CONSUL_NSPACES_ENABLED: '{{ if .NamespacesEnabled }}{{.NamespacesEnabled}}{{ else }}false{{ end }}', }); diff --git a/ui-v2/node-tests/config/environment.js b/ui-v2/node-tests/config/environment.js index 8caac5262a..252e7846c9 100644 --- a/ui-v2/node-tests/config/environment.js +++ b/ui-v2/node-tests/config/environment.js @@ -9,8 +9,8 @@ test( { environment: 'production', CONSUL_BINARY_TYPE: 'oss', - CONSUL_ACLS_ENABLED: '{{.ACLsEnabled}}', - CONSUL_SSO_ENABLED: '{{.SSOEnabled}}', + CONSUL_ACLS_ENABLED: '{{ if .ACLsEnabled }}{{.ACLsEnabled}}{{ else }}false{{ end }}', + CONSUL_SSO_ENABLED: '{{ if .SSOEnabled }}{{.SSOEnabled}}{{ else }}false{{ end }}', CONSUL_NSPACES_ENABLED: '{{ if .NamespacesEnabled }}{{.NamespacesEnabled}}{{ else }}false{{ end }}', }, {