diff --git a/cmd/create-account/main.go b/cmd/create-account/main.go index 9c0e71870..7f6d5105e 100644 --- a/cmd/create-account/main.go +++ b/cmd/create-account/main.go @@ -100,7 +100,10 @@ func main() { } } - b := base.NewBaseDendrite(cfg, "", base.CreateAccountMode) + // avoid warning about open registration + cfg.ClientAPI.RegistrationDisabled = true + + b := base.NewBaseDendrite(cfg, "") defer b.Close() // nolint: errcheck accountDB, err := storage.NewUserAPIDatabase( diff --git a/setup/base/base.go b/setup/base/base.go index 9027ccc2e..5cbd7da9c 100644 --- a/setup/base/base.go +++ b/setup/base/base.go @@ -100,7 +100,6 @@ const ( DisableMetrics BaseDendriteOptions = iota UseHTTPAPIs PolylithMode - CreateAccountMode ) // NewBaseDendrite creates a new instance to be used by a component. @@ -111,7 +110,6 @@ func NewBaseDendrite(cfg *config.Dendrite, componentName string, options ...Base useHTTPAPIs := false enableMetrics := true isMonolith := true - createAccountMode := false for _, opt := range options { switch opt { case DisableMetrics: @@ -121,9 +119,6 @@ func NewBaseDendrite(cfg *config.Dendrite, componentName string, options ...Base case PolylithMode: isMonolith = false useHTTPAPIs = true - case CreateAccountMode: - createAccountMode = true - cfg.ClientAPI.OpenRegistrationWithoutVerificationEnabled = true } } @@ -142,7 +137,7 @@ func NewBaseDendrite(cfg *config.Dendrite, componentName string, options ...Base logrus.Infof("Dendrite version %s", internal.VersionString()) - if !createAccountMode && !cfg.ClientAPI.RegistrationDisabled && cfg.ClientAPI.OpenRegistrationWithoutVerificationEnabled { + if !cfg.ClientAPI.RegistrationDisabled && cfg.ClientAPI.OpenRegistrationWithoutVerificationEnabled { logrus.Warn("Open registration is enabled") }