mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 06:24:11 +01:00 
			
		
		
		
	Use better name for userinfo structure (#32544)
This commit is contained in:
		
							parent
							
								
									c3dedcffa7
								
							
						
					
					
						commit
						f122aaf9ff
					
				@ -80,12 +80,12 @@ func (err errCallback) Error() string {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type userInfoResponse struct {
 | 
			
		||||
	Sub      string   `json:"sub"`
 | 
			
		||||
	Name     string   `json:"name"`
 | 
			
		||||
	Username string   `json:"preferred_username"`
 | 
			
		||||
	Email    string   `json:"email"`
 | 
			
		||||
	Picture  string   `json:"picture"`
 | 
			
		||||
	Groups   []string `json:"groups"`
 | 
			
		||||
	Sub               string   `json:"sub"`
 | 
			
		||||
	Name              string   `json:"name"`
 | 
			
		||||
	PreferredUsername string   `json:"preferred_username"`
 | 
			
		||||
	Email             string   `json:"email"`
 | 
			
		||||
	Picture           string   `json:"picture"`
 | 
			
		||||
	Groups            []string `json:"groups"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// InfoOAuth manages request for userinfo endpoint
 | 
			
		||||
@ -97,11 +97,11 @@ func InfoOAuth(ctx *context.Context) {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	response := &userInfoResponse{
 | 
			
		||||
		Sub:      fmt.Sprint(ctx.Doer.ID),
 | 
			
		||||
		Name:     ctx.Doer.FullName,
 | 
			
		||||
		Username: ctx.Doer.Name,
 | 
			
		||||
		Email:    ctx.Doer.Email,
 | 
			
		||||
		Picture:  ctx.Doer.AvatarLink(ctx),
 | 
			
		||||
		Sub:               fmt.Sprint(ctx.Doer.ID),
 | 
			
		||||
		Name:              ctx.Doer.FullName,
 | 
			
		||||
		PreferredUsername: ctx.Doer.Name,
 | 
			
		||||
		Email:             ctx.Doer.Email,
 | 
			
		||||
		Picture:           ctx.Doer.AvatarLink(ctx),
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	groups, err := oauth2_provider.GetOAuthGroupsForUser(ctx, ctx.Doer)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user