fix(user cmd): fix password update panic
All checks were successful
build / build (push) Successful in 43s
All checks were successful
build / build (push) Successful in 43s
This commit is contained in:
parent
8eb41be04a
commit
ea1c8254b4
1 changed files with 2 additions and 2 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue