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 <gary@garymoon.net>
Co-authored-by: Gary Moon <garymoon@users.noreply.github.com>
This commit is contained in:
Giteabot 2023-04-25 15:25:08 -04:00 committed by GitHub
parent 1254a8271e
commit 1bbbeb24ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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