Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't force a password change for the admin user when creating an account via cli #5391

Merged
merged 3 commits into from
Nov 25, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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 committed Nov 25, 2018
commit bd3efbdcd4c83db190aa54fdef16e3d699c1058c
8 changes: 4 additions & 4 deletions cmd/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,16 +322,16 @@ func runCreateUser(c *cli.Context) error {
// always default to true
var changePassword = true

if c.IsSet("must-change-password") {
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.
if n := models.CountUsers(); n == 0 {
changePassword = false
adelowo marked this conversation as resolved.
Show resolved Hide resolved
}

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

if err := models.CreateUser(&models.User{
Name: c.String("name"),
Email: c.String("email"),
Expand Down