Apply DefaultUserIsRestricted in CreateUser

This commit is contained in:
Jimmy Praet 2022-04-01 19:26:49 +02:00
parent 7b4c3c7bb1
commit 9020faa3ce
3 changed files with 12 additions and 13 deletions

View file

@ -867,14 +867,13 @@ func SignInOAuthCallback(ctx *context.Context) {
return
}
u = &user_model.User{
Name: getUserName(&gothUser),
FullName: gothUser.Name,
Email: gothUser.Email,
IsActive: !setting.OAuth2Client.RegisterEmailConfirm,
LoginType: auth.OAuth2,
LoginSource: authSource.ID,
LoginName: gothUser.UserID,
IsRestricted: setting.Service.DefaultUserIsRestricted,
Name: getUserName(&gothUser),
FullName: gothUser.Name,
Email: gothUser.Email,
IsActive: !setting.OAuth2Client.RegisterEmailConfirm,
LoginType: auth.OAuth2,
LoginSource: authSource.ID,
LoginName: gothUser.UserID,
}
setUserGroupClaims(authSource, u, &gothUser)