fix(user cmd): fix password update panic
All checks were successful
build / build (push) Successful in 43s

This commit is contained in:
Thomas Maurice 2024-06-28 12:04:29 +02:00
parent 8eb41be04a
commit ea1c8254b4
Signed by: thomas
GPG key ID: E0D9570F696C1431

View file

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