diff options
Diffstat (limited to 'routers/user/setting/account.go')
-rw-r--r-- | routers/user/setting/account.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/routers/user/setting/account.go b/routers/user/setting/account.go index 71d98fd3b9..c782224216 100644 --- a/routers/user/setting/account.go +++ b/routers/user/setting/account.go @@ -13,6 +13,7 @@ import ( "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/log" + "code.gitea.io/gitea/modules/password" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/timeutil" "code.gitea.io/gitea/services/mailer" @@ -52,6 +53,8 @@ func AccountPost(ctx *context.Context, form auth.ChangePasswordForm) { ctx.Flash.Error(ctx.Tr("settings.password_incorrect")) } else if form.Password != form.Retype { ctx.Flash.Error(ctx.Tr("form.password_not_match")) + } else if !password.IsComplexEnough(form.Password) { + ctx.Flash.Error(ctx.Tr("settings.password_complexity")) } else { var err error if ctx.User.Salt, err = models.GetUserSalt(); err != nil { |