From e9bdca5f09b2f9ad0ea2edc19435277f97134e3a Mon Sep 17 00:00:00 2001 From: famfo Date: Sun, 17 Mar 2024 12:07:06 +0100 Subject: [PATCH] Fix must-change-password help dialog --- cmd/admin_user_create.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/cmd/admin_user_create.go b/cmd/admin_user_create.go index a257ce21c8..10965c7e8f 100644 --- a/cmd/admin_user_create.go +++ b/cmd/admin_user_create.go @@ -47,7 +47,8 @@ var microcmdUserCreate = &cli.Command{ }, &cli.BoolFlag{ Name: "must-change-password", - Usage: "Set this option to false to prevent forcing the user to change their password after initial login, (Default: true)", + Usage: "Set this option to false to prevent forcing the user to change their password after initial login", + Value: true, }, &cli.IntFlag{ Name: "random-password-length", @@ -110,8 +111,7 @@ func runCreateUser(c *cli.Context) error { return errors.New("must set either password or random-password flag") } - // always default to true - changePassword := true + changePassword := c.Bool("must-change-password") // If this is the first user being created. // Take it as the admin and don't force a password update. @@ -119,10 +119,6 @@ func runCreateUser(c *cli.Context) error { changePassword = false } - if c.IsSet("must-change-password") { - changePassword = c.Bool("must-change-password") - } - restricted := optional.None[bool]() if c.IsSet("restricted") {