mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
Sync GitHub OAuth user name to Grafana if it's set (#45438)
This commit is contained in:
parent
db5f480a8f
commit
5fc5de8d5f
@ -182,6 +182,7 @@ func (s *SocialGithub) UserInfo(client *http.Client, token *oauth2.Token) (*Basi
|
||||
Id int `json:"id"`
|
||||
Login string `json:"login"`
|
||||
Email string `json:"email"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
response, err := s.httpGet(client, s.apiUrl)
|
||||
@ -208,6 +209,9 @@ func (s *SocialGithub) UserInfo(client *http.Client, token *oauth2.Token) (*Basi
|
||||
Email: data.Email,
|
||||
Groups: teams,
|
||||
}
|
||||
if data.Name != "" {
|
||||
userInfo.Name = data.Name
|
||||
}
|
||||
|
||||
organizationsUrl := fmt.Sprintf(s.apiUrl + "/orgs")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user