mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-11 05:09:31 +01:00
Validate email in oauth registration form (#15014)
This commit is contained in:
parent
7019076f7f
commit
df891dc59f
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue