Prechádzať zdrojové kódy

social: gitlab_oauth: set user ID in case email changes

Set `BasicUserInfo.Id` in the value returned by
`SocialGitlab.UserInfo()`, in case the email address of the user changes
in GitLab. That way, the user association won't be lost in Grafana.
Benoît Knecht 7 rokov pred
rodič
commit
ce804e9981
1 zmenil súbory, kde vykonal 1 pridanie a 0 odobranie
  1. 1 0
      pkg/social/gitlab_oauth.go

+ 1 - 0
pkg/social/gitlab_oauth.go

@@ -118,6 +118,7 @@ func (s *SocialGitlab) UserInfo(client *http.Client, token *oauth2.Token) (*Basi
 	}
 
 	userInfo := &BasicUserInfo{
+		Id:    fmt.Sprintf("%d", data.Id),
 		Name:  data.Name,
 		Login: data.Username,
 		Email: data.Email,