mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-22 08:38:29 +00:00
[GITEA] Add password length check on install page
- Resolves #271 - Ensure that the adminstrator password is at least `MIN_PASSWORD_LENGTH`. (cherry picked from commit28cb04c3f5
) (cherry picked from commit95371ebd92
) (cherry picked from commita134288ab6
) (cherry picked from commit4202f052cb
) (cherry picked from commit510b7467d3
) (cherry picked from commitf3a6e1f121
) (cherry picked from commitf340508819
) (cherry picked from commitb891bb176d
) (cherry picked from commit1a1bfc38cc
) (cherry picked from commit083d5aefed
) (cherry picked from commit4586096be9
) (cherry picked from commit039fa20cc8
) (cherry picked from commit3ec9cb5f59
) (cherry picked from commit00be0eee37
) (cherry picked from commita156603002
) (cherry picked from commit4d305e7774
) (cherry picked from commit51e8f21202
) (cherry picked from commit58e354c98e
) (cherry picked from commit20405564f5
) (cherry picked from commit1d7f495683
) (cherry picked from commitd457b9c911
) (cherry picked from commit72b54bc4cc
) (cherry picked from commitd7ce723e35
) (cherry picked from commitce5f863d5d
) (cherry picked from commit324b9318ac
) (cherry picked from commitfff11fc535
) (cherry picked from commitd3fa04aa69
) (cherry picked from commitd3b24691f3
) (cherry picked from commit736dfab3ae
) (cherry picked from commit8be95ef7f4
)
This commit is contained in:
parent
133dc72fab
commit
0ce04d93a8
|
@ -358,6 +358,12 @@ func SubmitInstall(ctx *context.Context) {
|
|||
ctx.RenderWithErr(ctx.Tr("form.password_not_match"), tplInstall, form)
|
||||
return
|
||||
}
|
||||
if len(form.AdminPasswd) < setting.MinPasswordLength {
|
||||
ctx.Data["Err_Admin"] = true
|
||||
ctx.Data["Err_AdminPasswd"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("auth.password_too_short", setting.MinPasswordLength), tplInstall, form)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Init the engine with migration
|
||||
|
|
Loading…
Reference in a new issue