diff options
author | guillep2k <18600385+guillep2k@users.noreply.github.com> | 2019-11-19 19:44:58 -0300 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-11-19 22:44:58 +0000 |
commit | c57edb6c7b5066da2b0f526e6ab9f7842fd785fb (patch) | |
tree | 68d44a4dbc58f8ade1373eb30fe850410511ce43 /routers/admin | |
parent | eb0359cad4b725553c8bca3e95ada9c789c5da0b (diff) | |
download | gitea-c57edb6c7b5066da2b0f526e6ab9f7842fd785fb.tar.gz gitea-c57edb6c7b5066da2b0f526e6ab9f7842fd785fb.zip |
Add password requirement info on error (#9074)
* Add password requirement info on error
* Move BuildComplexityError to the password pkg
* Unexport complexity type
* Fix extra line
* Update modules/password/password.go
Co-Authored-By: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'routers/admin')
-rw-r--r-- | routers/admin/users.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/admin/users.go b/routers/admin/users.go index 2284f21838..7626fbc0d0 100644 --- a/routers/admin/users.go +++ b/routers/admin/users.go @@ -96,7 +96,7 @@ func NewUserPost(ctx *context.Context, form auth.AdminCreateUserForm) { } if u.LoginType == models.LoginPlain { if !password.IsComplexEnough(form.Password) { - ctx.RenderWithErr(ctx.Tr("form.password_complexity"), tplUserNew, &form) + ctx.RenderWithErr(password.BuildComplexityError(ctx), tplUserNew, &form) return } u.MustChangePassword = form.MustChangePassword @@ -208,7 +208,7 @@ func EditUserPost(ctx *context.Context, form auth.AdminEditUserForm) { return } if !password.IsComplexEnough(form.Password) { - ctx.RenderWithErr(ctx.Tr("form.password_complexity"), tplUserEdit, &form) + ctx.RenderWithErr(password.BuildComplexityError(ctx), tplUserEdit, &form) return } u.HashPassword(form.Password) |