summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorguillep2k <18600385+guillep2k@users.noreply.github.com>2019-11-09 00:40:37 -0300
committerLunny Xiao <xiaolunwen@gmail.com>2019-11-09 11:40:37 +0800
commit6e1912c73ac3b350593efbe4e3ac8f37b052e008 (patch)
tree9d409e3ac579a67dc5103202df8c4dfa2afbbf55 /routers
parent9ae4c17cb1fde0eaa1556e545a8871b6a70d2efa (diff)
downloadgitea-6e1912c73ac3b350593efbe4e3ac8f37b052e008.tar.gz
gitea-6e1912c73ac3b350593efbe4e3ac8f37b052e008.zip
Fix password complexity check on registration (#8887)
* Fix registration password complexity * Fix integration to use a complex password ;)
Diffstat (limited to 'routers')
-rw-r--r--routers/user/auth.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/user/auth.go b/routers/user/auth.go
index 82a508e4dc..b328ac094e 100644
--- a/routers/user/auth.go
+++ b/routers/user/auth.go
@@ -1070,6 +1070,11 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo
ctx.RenderWithErr(ctx.Tr("auth.password_too_short", setting.MinPasswordLength), tplSignUp, &form)
return
}
+ if !password.IsComplexEnough(form.Password) {
+ ctx.Data["Err_Password"] = true
+ ctx.RenderWithErr(ctx.Tr("form.password_complexity"), tplSignUp, &form)
+ return
+ }
u := &models.User{
Name: form.UserName,