fix: add configurable minimum password length (#5225)

This commit is contained in:
Henrique Dias
2025-06-28 10:07:34 +02:00
committed by GitHub
parent 089255997a
commit 464b644adf
21 changed files with 122 additions and 77 deletions

View File

@@ -27,8 +27,10 @@ options you want to change.`,
password := mustGetString(flags, "password")
newUsername := mustGetString(flags, "username")
s, err := d.store.Settings.Get()
checkErr(err)
var (
err error
user *users.User
)
@@ -64,7 +66,7 @@ options you want to change.`,
}
if password != "" {
user.Password, err = users.HashPwd(password)
user.Password, err = users.HashAndValidatePwd(password, s.MinimumPasswordLength)
checkErr(err)
}