Compare commits

...

1 commit

Author SHA1 Message Date
ea1c8254b4
fix(user cmd): fix password update panic
All checks were successful
build / build (push) Successful in 43s
2024-06-28 12:04:29 +02:00

View file

@ -208,7 +208,7 @@ var UserDeactivateCmd = &cobra.Command{
} }
var UserEditCmd = &cobra.Command{ var UserEditCmd = &cobra.Command{
Use: "edit", Use: "edit <user>",
Short: "edites a user", Short: "edites a user",
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
@ -251,7 +251,7 @@ var UserEditCmd = &cobra.Command{
} }
if flagUserPassword != "" { if flagUserPassword != "" {
passwordHash, err := bcrypt.GenerateFromPassword([]byte(args[1]), bcrypt.DefaultCost) passwordHash, err := bcrypt.GenerateFromPassword([]byte(flagUserPassword), bcrypt.DefaultCost)
if err != nil { if err != nil {
logrus.WithError(err).Fatal("could not compute user password hash") logrus.WithError(err).Fatal("could not compute user password hash")
} }