1
0
Fork 0
forked from forgejo/forgejo

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)