Skip to content

Commit

Permalink
Fix value of User.IsRestricted to default setting when oauth2 user au…
Browse files Browse the repository at this point in the history
…to registration;
  • Loading branch information
Tiscs committed Nov 28, 2021
1 parent 72d82c5 commit e82b90c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions routers/web/user/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e82b90c

Please sign in to comment.