diff --git a/api/api.go b/api/api.go index 0d99d799..ce4719e2 100644 --- a/api/api.go +++ b/api/api.go @@ -757,7 +757,7 @@ func (api *api) Setup(ctx context.Context, setupRequest *SetupRequest) error { return errors.New("no unlock password provided") } - err = api.cfg.Setup(setupRequest.UnlockPassword) + err = api.cfg.SaveUnlockPasswordCheck(setupRequest.UnlockPassword) if err != nil { return err } diff --git a/config/config.go b/config/config.go index 9c743772..84eeeec5 100644 --- a/config/config.go +++ b/config/config.go @@ -256,8 +256,7 @@ func (cfg *config) CheckUnlockPassword(encryptionKey string) bool { return err == nil && (decryptedValue == "" || decryptedValue == unlockPasswordCheck) } -// TODO: rename -func (cfg *config) Setup(encryptionKey string) error { +func (cfg *config) SaveUnlockPasswordCheck(encryptionKey string) error { err := cfg.SetUpdate("UnlockPasswordCheck", unlockPasswordCheck, encryptionKey) if err != nil { logger.Logger.WithError(err).Error("Failed to save unlock password check to config") diff --git a/config/models.go b/config/models.go index 42e75306..0491494b 100644 --- a/config/models.go +++ b/config/models.go @@ -57,6 +57,6 @@ type Config interface { GetEnv() *AppConfig CheckUnlockPassword(password string) bool ChangeUnlockPassword(currentUnlockPassword string, newUnlockPassword string) error - Setup(encryptionKey string) error + SaveUnlockPasswordCheck(encryptionKey string) error SetupCompleted() bool }