Skip to content

Commit fbadc1a

Browse files
authored
Fix value of User.IsRestricted to default setting when oauth2 user auto registration; (#17839)
1 parent 72d82c5 commit fbadc1a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

routers/web/user/auth.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -681,13 +681,14 @@ func SignInOAuthCallback(ctx *context.Context) {
681681
return
682682
}
683683
u = &user_model.User{
684-
Name: getUserName(&gothUser),
685-
FullName: gothUser.Name,
686-
Email: gothUser.Email,
687-
IsActive: !setting.OAuth2Client.RegisterEmailConfirm,
688-
LoginType: login.OAuth2,
689-
LoginSource: loginSource.ID,
690-
LoginName: gothUser.UserID,
684+
Name: getUserName(&gothUser),
685+
FullName: gothUser.Name,
686+
Email: gothUser.Email,
687+
IsActive: !setting.OAuth2Client.RegisterEmailConfirm,
688+
LoginType: login.OAuth2,
689+
LoginSource: loginSource.ID,
690+
LoginName: gothUser.UserID,
691+
IsRestricted: setting.Service.DefaultUserIsRestricted,
691692
}
692693

693694
if !createAndHandleCreatedUser(ctx, base.TplName(""), nil, u, &gothUser, setting.OAuth2Client.AccountLinking != setting.OAuth2AccountLinkingDisabled) {

0 commit comments

Comments
 (0)