Closed
Description
- Gitea version (or commit ref): master
- Can you reproduce the bug at https://try.gitea.io:
- Yes (provide example URL)
- No
- Not relevant
Description
If the CLI is used to create a user, lack of the must-change-password
flag would imply that the new user doesn't need to change their password, however that is not what happens.
When creating a user via the CLI, the must-change-password
flag loses meaning after the first user is created (presumably the admin)
// 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")
}
I think there are probably two options based on the "wanted" default behavior.
- Set
changePassword
tofalse
by default, as that will line up with the intended use of the flag. - Remove the
must-change-password
flag and optionally add a different flag with the opposite meaning. This would mean that users created via CLI would, by default, need to change their password, unless the new flag is applied.
Metadata
Metadata
Assignees
Labels
No labels