1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-05-11 05:55:29 +00:00

Block registration based on email domain (#5157)

* implement email domain whitelist
This commit is contained in:
Lanre Adelowo
2018-11-15 02:00:04 +01:00
committed by techknowlogick
parent 4c1f1f9646
commit b97af15de6
7 changed files with 106 additions and 0 deletions

View File

@@ -948,6 +948,11 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo
}
}
if !form.IsEmailDomainWhitelisted() {
ctx.RenderWithErr(ctx.Tr("auth.email_domain_blacklisted"), tplSignUp, &form)
return
}
if form.Password != form.Retype {
ctx.Data["Err_Password"] = true
ctx.RenderWithErr(ctx.Tr("form.password_not_match"), tplSignUp, &form)