forked from forgejo/forgejo
Block registration based on email domain (#5157)
* implement email domain whitelist
This commit is contained in:
parent
4c1f1f9646
commit
b97af15de6
7 changed files with 106 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue