remove todo comments

This commit is contained in:
Henry Dollman
2024-11-29 17:16:40 -05:00
parent 617a03fc15
commit 6e08507dde
5 changed files with 6 additions and 7 deletions

View File

@@ -210,7 +210,6 @@ func (h *Hub) getUserEmailMap(userIDs []string) (map[string]string, error) {
// Returns the current config.yml file as a JSON object
func (h *Hub) getYamlConfig(e *core.RequestEvent) error {
info, _ := e.RequestInfo()
// todo: test
if info.Auth == nil || info.Auth.GetString("role") != "admin" {
return apis.NewForbiddenError("Forbidden", nil)
}

View File

@@ -80,13 +80,15 @@ func (h *Hub) Run() {
return err
}
// disable email auth if DISABLE_PASSWORD_AUTH env var is set
// todo: test email login and DISABLE_PASSWORD_AUTH env var (do we need to save usersCollection?)
if os.Getenv("DISABLE_PASSWORD_AUTH") == "true" {
usersCollection.PasswordAuth.Enabled = false
} else {
usersCollection.PasswordAuth.Enabled = true
usersCollection.PasswordAuth.IdentityFields = []string{"email"}
}
if err := h.app.Save(usersCollection); err != nil {
return err
}
// sync systems with config
h.syncSystemsWithConfig()
return se.Next()
@@ -318,7 +320,7 @@ func (h *Hub) updateSystem(record *core.Record) {
}
}
// system info alerts (todo: extra fs alerts)
// system info alerts
if err := h.am.HandleSystemAlerts(record, systemData.Info, systemData.Stats.Temperatures, systemData.Stats.ExtraFs); err != nil {
h.app.Logger().Error("System alerts error", "err", err.Error())
}