mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-10-23 18:42:26 +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)
This commit is contained in:
parent
6afe70bbf1
commit
039fa20cc8
1 changed files with 6 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue