aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/user/auth.go
diff options
context:
space:
mode:
authorGalen Suen <tiscs@live.com>2021-11-28 11:27:48 +0800
committerGitHub <noreply@github.com>2021-11-28 11:27:48 +0800
commitfbadc1a1982f9133ecc8a7f9debe32525703eb27 (patch)
treef7b175b29360d52785025fe75611ece13bd01a4b /routers/web/user/auth.go
parent72d82c5b6fe7153c849738b591133c9bb52a96f7 (diff)
downloadgitea-fbadc1a1982f9133ecc8a7f9debe32525703eb27.tar.gz
gitea-fbadc1a1982f9133ecc8a7f9debe32525703eb27.zip
Fix value of User.IsRestricted to default setting when oauth2 user auto registration; (#17839)
Diffstat (limited to 'routers/web/user/auth.go')
-rw-r--r--routers/web/user/auth.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/routers/web/user/auth.go b/routers/web/user/auth.go
index 02f5afd8ba..a71a278958 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) {