diff options
author | Lanre Adelowo <adelowomailbox@gmail.com> | 2018-11-15 02:00:04 +0100 |
---|---|---|
committer | techknowlogick <hello@techknowlogick.com> | 2018-11-14 20:00:04 -0500 |
commit | b97af15de67b04fd259bd70a4abbc873f12e9491 (patch) | |
tree | 9a88d821a0ec98edc6dba64804ca6d0692df91fe /routers/user | |
parent | 4c1f1f96465e809161f7d634a07eb60b4511db35 (diff) | |
download | gitea-b97af15de67b04fd259bd70a4abbc873f12e9491.tar.gz gitea-b97af15de67b04fd259bd70a4abbc873f12e9491.zip |
Block registration based on email domain (#5157)
* implement email domain whitelist
Diffstat (limited to 'routers/user')
-rw-r--r-- | routers/user/auth.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/user/auth.go b/routers/user/auth.go index 25aa437efd..24b35e6f62 100644 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -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) |