1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-11-30 08:06:52 +02:00

Merge pull request #1560 from iamjarvo/auth-with-ghe

Match user url against default api url
This commit is contained in:
Brad Rydzewski 2016-04-02 13:59:35 -07:00
commit a9c84d26e1

View File

@ -58,7 +58,7 @@ func GetUserEmail(client *github.Client) (*github.User, error) {
// WARNING, HACK
// for out-of-date github enterprise editions the primary
// and verified fields won't exist.
if !strings.HasPrefix(*user.HTMLURL, DefaultURL) && len(emails) != 0 {
if !strings.HasPrefix(*user.URL, DefaultAPI) && len(emails) != 0 {
user.Email = emails[0].Email
return user, nil
}