From ce804e9981c96e4907dd53f7b0358bf5d88ce7c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Knecht?= Date: Fri, 3 Aug 2018 15:35:04 +0200 Subject: [PATCH] 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. --- pkg/social/gitlab_oauth.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/social/gitlab_oauth.go b/pkg/social/gitlab_oauth.go index 22e50b9653a..21463dabf8f 100644 --- a/pkg/social/gitlab_oauth.go +++ b/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,