From 4457d0e8d9b09e7577242a8bc005ef9d43be4e8c Mon Sep 17 00:00:00 2001
From: Michel Ganguin <michel@ganguin.net>
Date: Fri, 5 Feb 2021 04:03:20 +0100
Subject: [PATCH] Honor REGISTER_MANUAL_CONFIRM when doing openid registration
 (#14548)

REGISTER_MANUAL_CONFIRM is not honored when doing performing an openid registration. The new account is directly accessible.

With this patch, the manual confirm flag gets honored in the same way as a "normal" registration.
---
 routers/user/auth_openid.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/routers/user/auth_openid.go b/routers/user/auth_openid.go
index 3f5c9f7248..e79085e94d 100644
--- a/routers/user/auth_openid.go
+++ b/routers/user/auth_openid.go
@@ -415,7 +415,7 @@ func RegisterOpenIDPost(ctx *context.Context) {
 		Name:     form.UserName,
 		Email:    form.Email,
 		Passwd:   password,
-		IsActive: !setting.Service.RegisterEmailConfirm,
+		IsActive: !(setting.Service.RegisterEmailConfirm || setting.Service.RegisterManualConfirm),
 	}
 	//nolint: dupl
 	if err := models.CreateUser(u); err != nil {