]> source.dussan.org Git - gitea.git/commitdiff
Respect the REGISTER_MANUAL_CONFIRM setting when registering via OIDC (#24035) (...
authorGiteabot <teabot@gitea.io>
Tue, 25 Apr 2023 19:25:08 +0000 (15:25 -0400)
committerGitHub <noreply@github.com>
Tue, 25 Apr 2023 19:25:08 +0000 (15:25 -0400)
Backport #24035 by @garymoon

This change prevents Gitea from bypassing the manual approval process
for newly registered users when OIDC is used.

- Resolves https://github.com/go-gitea/gitea/issues/23392

Signed-off-by: Gary Moon <gary@garymoon.net>
Co-authored-by: Gary Moon <garymoon@users.noreply.github.com>
routers/web/auth/oauth.go

index 7de63dbe94ffeae765beb69a9a61c659672db581..456dcfd4a8da4497c23ccbfe3611e6a4982a0696 100644 (file)
@@ -963,7 +963,7 @@ func SignInOAuthCallback(ctx *context.Context) {
                        }
 
                        overwriteDefault := &user_model.CreateUserOverwriteOptions{
-                               IsActive: util.OptionalBoolOf(!setting.OAuth2Client.RegisterEmailConfirm),
+                               IsActive: util.OptionalBoolOf(!setting.OAuth2Client.RegisterEmailConfirm && !setting.Service.RegisterManualConfirm),
                        }
 
                        source := authSource.Cfg.(*oauth2.Source)