summaryrefslogtreecommitdiffstats
path: root/routers/user/auth.go
diff options
context:
space:
mode:
authorguillep2k <18600385+guillep2k@users.noreply.github.com>2019-11-19 19:44:58 -0300
committerzeripath <art27@cantab.net>2019-11-19 22:44:58 +0000
commitc57edb6c7b5066da2b0f526e6ab9f7842fd785fb (patch)
tree68d44a4dbc58f8ade1373eb30fe850410511ce43 /routers/user/auth.go
parenteb0359cad4b725553c8bca3e95ada9c789c5da0b (diff)
downloadgitea-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/user/auth.go')
-rw-r--r--routers/user/auth.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/user/auth.go b/routers/user/auth.go
index cb5611e045..d0ad4afffd 100644
--- a/routers/user/auth.go
+++ b/routers/user/auth.go
@@ -1072,7 +1072,7 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo
}
if !password.IsComplexEnough(form.Password) {
ctx.Data["Err_Password"] = true
- ctx.RenderWithErr(ctx.Tr("form.password_complexity"), tplSignUp, &form)
+ ctx.RenderWithErr(password.BuildComplexityError(ctx), tplSignUp, &form)
return
}
@@ -1343,7 +1343,7 @@ func ResetPasswdPost(ctx *context.Context) {
} else if !password.IsComplexEnough(passwd) {
ctx.Data["IsResetForm"] = true
ctx.Data["Err_Password"] = true
- ctx.RenderWithErr(ctx.Tr("form.password_complexity"), tplResetPassword, nil)
+ ctx.RenderWithErr(password.BuildComplexityError(ctx), tplResetPassword, nil)
return
}