#220 安全注册接口优化:增加密码最小长度限制

Merged
avadesian merged 1 commits from fix-179 into V20210731.patch 2 years ago
  1. +1
    -1
      routers/secure/user.go

+ 1
- 1
routers/secure/user.go View File

@@ -88,7 +88,7 @@ func CreateUser(ctx *context.Context, form api.CreateUserOption) {
if ctx.Written() {
return
}
if !password.IsComplexEnough(form.Password) {
if !password.IsComplexEnough(form.Password) || len(form.Password) < setting.MinPasswordLength {
log.Error("CreateUser failed: PasswordComplexity", ctx.Data["MsgID"])
ctx.JSON(http.StatusBadRequest, map[string]string{
"error_msg": "PasswordComplexity",


Loading…
Cancel
Save