浏览代码

pkg/social/github: Allow changing of userinfo data (#12471)

Experienced a problem where a user whose email changed was no longer
able to login. By using the ID as a primary identifier, we can avoid
conflicts of this variety within the github OAuth provider.
Will Weber 7 年之前
父节点
当前提交
c03d527d25
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      pkg/social/github_oauth.go

+ 1 - 0
pkg/social/github_oauth.go

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