Skip to content

Commit

Permalink
Fix cli output to stdout on user creation
Browse files Browse the repository at this point in the history
  • Loading branch information
petergrlica authored and darh committed Nov 2, 2021
1 parent 402006b commit 680f4db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions system/commands/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ func Users(ctx context.Context, app serviceInitializer) *cobra.Command {
}

// generate the create password link of user
if !flagNoPassword && len(password) == 0 && flagMakePasswordLink {
if flagNoPassword && len(password) == 0 && flagMakePasswordLink {
url, err = authSvc.GeneratePasswordCreateToken(ctx, user.Email)
if err != nil {
cli.HandleError(err)
}
}

cmd.Printf("User created [%d].\n", user.ID)
fmt.Fprintf(cmd.OutOrStdout(), "User created [%d].\n", user.ID)

if flagMakePasswordLink && len(url) > 0 {
cmd.Println("Set password by clicking here:")
cmd.Printf("%s\n", url)
fmt.Fprintf(cmd.OutOrStdout(), "Set password by clicking here:\n%s\n", url)
}

if len(mm) > 0 {
Expand Down

0 comments on commit 680f4db

Please sign in to comment.