From 1bbbeb24ef86a702b9f0f77410ee2baf64b975c5 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 25 Apr 2023 15:25:08 -0400 Subject: [PATCH] Respect the REGISTER_MANUAL_CONFIRM setting when registering via OIDC (#24035) (#24333) 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 Co-authored-by: Gary Moon --- routers/web/auth/oauth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/auth/oauth.go b/routers/web/auth/oauth.go index 7de63dbe94..456dcfd4a8 100644 --- a/routers/web/auth/oauth.go +++ b/routers/web/auth/oauth.go @@ -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)