diff --git a/app/config.go b/app/config.go index eaa04a862d..1c230c864d 100644 --- a/app/config.go +++ b/app/config.go @@ -281,6 +281,7 @@ func (a *App) AsymmetricSigningKey() *ecdsa.PrivateKey { func (a *App) regenerateClientConfig() { a.Srv.clientConfig = utils.GenerateClientConfig(a.Config(), a.DiagnosticId(), a.License()) + a.Srv.limitedClientConfig = utils.GenerateLimitedClientConfig(a.Config(), a.DiagnosticId(), a.License()) if a.Srv.clientConfig["EnableCustomTermsOfService"] == "true" { termsOfService, err := a.GetLatestTermsOfService() @@ -288,11 +289,10 @@ func (a *App) regenerateClientConfig() { mlog.Err(err) } else { a.Srv.clientConfig["CustomTermsOfServiceId"] = termsOfService.Id + a.Srv.limitedClientConfig["CustomTermsOfServiceId"] = termsOfService.Id } } - a.Srv.limitedClientConfig = utils.GenerateLimitedClientConfig(a.Config(), a.DiagnosticId(), a.License()) - if key := a.AsymmetricSigningKey(); key != nil { der, _ := x509.MarshalPKIXPublicKey(&key.PublicKey) a.Srv.clientConfig["AsymmetricSigningPublicKey"] = base64.StdEncoding.EncodeToString(der) diff --git a/utils/config.go b/utils/config.go index 7fc644155f..f08237cb6c 100644 --- a/utils/config.go +++ b/utils/config.go @@ -688,11 +688,6 @@ func GenerateClientConfig(c *model.Config, diagnosticId string, license *model.L props["DataRetentionEnableFileDeletion"] = strconv.FormatBool(*c.DataRetentionSettings.EnableFileDeletion) props["DataRetentionFileRetentionDays"] = strconv.FormatInt(int64(*c.DataRetentionSettings.FileRetentionDays), 10) } - - if *license.Features.CustomTermsOfService { - props["EnableCustomTermsOfService"] = strconv.FormatBool(*c.SupportSettings.CustomTermsOfServiceEnabled) - props["CustomTermsOfServiceReAcceptancePeriod"] = strconv.FormatInt(int64(*c.SupportSettings.CustomTermsOfServiceReAcceptancePeriod), 10) - } } return props @@ -797,6 +792,11 @@ func GenerateLimitedClientConfig(c *model.Config, diagnosticId string, license * if *license.Features.Office365OAuth { props["EnableSignUpWithOffice365"] = strconv.FormatBool(c.Office365Settings.Enable) } + + if *license.Features.CustomTermsOfService { + props["EnableCustomTermsOfService"] = strconv.FormatBool(*c.SupportSettings.CustomTermsOfServiceEnabled) + props["CustomTermsOfServiceReAcceptancePeriod"] = strconv.FormatInt(int64(*c.SupportSettings.CustomTermsOfServiceReAcceptancePeriod), 10) + } } return props