Skip to content
16 changes: 11 additions & 5 deletions cmd/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ var (
Value: "custom/conf/app.ini",
Usage: "Custom configuration file path",
},
cli.StringFlag{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be cli.BoolFlag. Also why default to false if from UI default is true?

Name: "must-change-password",
Value: "false",
Usage: "Force the user to change his/her password after initial login",
},
},
}

Expand Down Expand Up @@ -286,11 +291,12 @@ func runCreateUser(c *cli.Context) error {
}

if err := models.CreateUser(&models.User{
Name: c.String("name"),
Email: c.String("email"),
Passwd: c.String("password"),
IsActive: true,
IsAdmin: c.Bool("admin"),
Name: c.String("name"),
Email: c.String("email"),
Passwd: c.String("password"),
IsActive: true,
IsAdmin: c.Bool("admin"),
MustChangePassword: c.Bool("must-change-password"),
}); err != nil {
return fmt.Errorf("CreateUser: %v", err)
}
Expand Down