Skip to content

Commit df891dc

Browse files
authored
Validate email in oauth registration form (#15014)
1 parent 7019076 commit df891dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

routers/user/auth.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,11 @@ func LinkAccountPostRegister(ctx *context.Context) {
942942
}
943943
}
944944

945+
if !form.IsEmailDomainAllowed() {
946+
ctx.RenderWithErr(ctx.Tr("auth.email_domain_blacklisted"), tplLinkAccount, &form)
947+
return
948+
}
949+
945950
if setting.Service.AllowOnlyExternalRegistration || !setting.Service.RequireExternalRegistrationPassword {
946951
// In models.User an empty password is classed as not set, so we set form.Password to empty.
947952
// Eventually the database should be changed to indicate "Second Factor"-enabled accounts

0 commit comments

Comments
 (0)