summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorKyle D <kdumontnu@gmail.com>2021-03-16 21:54:02 -0600
committerGitHub <noreply@github.com>2021-03-17 04:54:02 +0100
commitdf891dc59fd26394b63f5e50b8e2e61895f71c08 (patch)
tree3fbc597a03483930850ffc796ac32e6b37caee4f /routers/user
parent7019076f7f2e144c95f30469aea9d7c9cb52d9fb (diff)
downloadgitea-df891dc59fd26394b63f5e50b8e2e61895f71c08.tar.gz
gitea-df891dc59fd26394b63f5e50b8e2e61895f71c08.zip
Validate email in oauth registration form (#15014)
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/auth.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/user/auth.go b/routers/user/auth.go
index e5e8cc1151..37181c68e7 100644
--- a/routers/user/auth.go
+++ b/routers/user/auth.go
@@ -942,6 +942,11 @@ func LinkAccountPostRegister(ctx *context.Context) {
}
}
+ if !form.IsEmailDomainAllowed() {
+ ctx.RenderWithErr(ctx.Tr("auth.email_domain_blacklisted"), tplLinkAccount, &form)
+ return
+ }
+
if setting.Service.AllowOnlyExternalRegistration || !setting.Service.RequireExternalRegistrationPassword {
// In models.User an empty password is classed as not set, so we set form.Password to empty.
// Eventually the database should be changed to indicate "Second Factor"-enabled accounts