diff options
Diffstat (limited to 'app/config.go')
-rw-r--r-- | app/config.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/config.go b/app/config.go index a63650a58..fde38c13e 100644 --- a/app/config.go +++ b/app/config.go @@ -23,6 +23,10 @@ import ( "github.com/mattermost/mattermost-server/utils" ) +const ( + ERROR_SERVICE_TERMS_NO_ROWS_FOUND = "store.sql_service_terms_store.get.no_rows.app_error" +) + func (a *App) Config() *model.Config { if cfg := a.config.Load(); cfg != nil { return cfg.(*model.Config) @@ -242,6 +246,16 @@ func (a *App) AsymmetricSigningKey() *ecdsa.PrivateKey { func (a *App) regenerateClientConfig() { a.clientConfig = utils.GenerateClientConfig(a.Config(), a.DiagnosticId(), a.License()) + + if a.clientConfig["EnableCustomServiceTerms"] == "true" { + serviceTerms, err := a.GetLatestServiceTerms() + if err != nil { + mlog.Err(err) + } else { + a.clientConfig["CustomServiceTermsId"] = serviceTerms.Id + } + } + a.limitedClientConfig = utils.GenerateLimitedClientConfig(a.Config(), a.DiagnosticId(), a.License()) if key := a.AsymmetricSigningKey(); key != nil { |