Skip to content

Commit

Permalink
Don't force a password change for the admin user when creating an acc…
Browse files Browse the repository at this point in the history
…ount via cli (#5391)

* don't force a password change for the admin user

* don't totally dicard -must-change-password flag if creating the first (admin) user via the cli. Use flag if present but make sure to default to not forcing a password update
  • Loading branch information
adelowo authored and lafriks committed Nov 25, 2018
1 parent 3379141 commit fd37fb0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@ func runCreateUser(c *cli.Context) error {
// always default to true
var changePassword = true

// If this is the first user being created.
// Take it as the admin and don't force a password update.
if n := models.CountUsers(); n == 0 {
changePassword = false
}

if c.IsSet("must-change-password") {
changePassword = c.Bool("must-change-password")
}
Expand Down

0 comments on commit fd37fb0

Please sign in to comment.