From fbadc1a1982f9133ecc8a7f9debe32525703eb27 Mon Sep 17 00:00:00 2001 From: Galen Suen Date: Sun, 28 Nov 2021 11:27:48 +0800 Subject: [PATCH] Fix value of User.IsRestricted to default setting when oauth2 user auto registration; (#17839) --- routers/web/user/auth.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/routers/web/user/auth.go b/routers/web/user/auth.go index 02f5afd8bae..a71a2789582 100644 --- a/routers/web/user/auth.go +++ b/routers/web/user/auth.go @@ -681,13 +681,14 @@ func SignInOAuthCallback(ctx *context.Context) { return } u = &user_model.User{ - Name: getUserName(&gothUser), - FullName: gothUser.Name, - Email: gothUser.Email, - IsActive: !setting.OAuth2Client.RegisterEmailConfirm, - LoginType: login.OAuth2, - LoginSource: loginSource.ID, - LoginName: gothUser.UserID, + Name: getUserName(&gothUser), + FullName: gothUser.Name, + Email: gothUser.Email, + IsActive: !setting.OAuth2Client.RegisterEmailConfirm, + LoginType: login.OAuth2, + LoginSource: loginSource.ID, + LoginName: gothUser.UserID, + IsRestricted: setting.Service.DefaultUserIsRestricted, } if !createAndHandleCreatedUser(ctx, base.TplName(""), nil, u, &gothUser, setting.OAuth2Client.AccountLinking != setting.OAuth2AccountLinkingDisabled) {