mirror of
https://github.com/go-gitea/gitea
synced 2024-12-25 01:54:26 +00:00
* Fix registration password complexity * Fix integration to use a complex password ;)
This commit is contained in:
parent
1275c88589
commit
fbcf235633
@ -19,8 +19,8 @@ func TestSignup(t *testing.T) {
|
|||||||
req := NewRequestWithValues(t, "POST", "/user/sign_up", map[string]string{
|
req := NewRequestWithValues(t, "POST", "/user/sign_up", map[string]string{
|
||||||
"user_name": "exampleUser",
|
"user_name": "exampleUser",
|
||||||
"email": "exampleUser@example.com",
|
"email": "exampleUser@example.com",
|
||||||
"password": "examplePassword",
|
"password": "examplePassword!1",
|
||||||
"retype": "examplePassword",
|
"retype": "examplePassword!1",
|
||||||
})
|
})
|
||||||
MakeRequest(t, req, http.StatusFound)
|
MakeRequest(t, req, http.StatusFound)
|
||||||
|
|
||||||
|
@ -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)
|
ctx.RenderWithErr(ctx.Tr("auth.password_too_short", setting.MinPasswordLength), tplSignUp, &form)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if !password.IsComplexEnough(form.Password) {
|
||||||
|
ctx.Data["Err_Password"] = true
|
||||||
|
ctx.RenderWithErr(ctx.Tr("form.password_complexity"), tplSignUp, &form)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
u := &models.User{
|
u := &models.User{
|
||||||
Name: form.UserName,
|
Name: form.UserName,
|
||||||
|
Loading…
Reference in New Issue
Block a user