Skip to content

Commit

Permalink
fix: set password against user when passed as flag
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajjs committed Jan 22, 2025
1 parent bb3ad91 commit 4b99a6c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ func Start() {
// and new users in a much better way. Doing this using
// and empty password check is not a good solution.
if config.Config.Password != "" {
_, _ = auth.UserStore.Add(config.Config.Username)
user, _ := auth.UserStore.Add(config.Config.Username)
if err:= user.SetPassword(config.Config.Password); err != nil {
slog.Error("Could not set password", slog.String("password", config.Config.Password), slog.Any("error", err))
return
}
}

ctx, cancel := context.WithCancel(context.Background())
Expand Down

0 comments on commit 4b99a6c

Please sign in to comment.