Skip to content

Commit

Permalink
chore: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Sep 25, 2024
1 parent 94d6d81 commit 630cfc8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 1 addition & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion config/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 630cfc8

Please sign in to comment.