Avoid warning about open registration

This commit is contained in:
Till Faelligen 2022-05-12 11:05:14 +02:00
parent 9722df46f8
commit d456cb5240
2 changed files with 5 additions and 7 deletions

View file

@ -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(

View file

@ -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")
}