mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Fix value of User.IsRestricted to default setting when oauth2 user auto registration; (#17839)
This commit is contained in:
		@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user