Commit e16bbc66 by Don

use [auth.github] -> api_url property; supports git enterprise

parent d7ee7cb8
...@@ -193,7 +193,7 @@ func (s *SocialGithub) FetchPrivateEmail(client *http.Client) (string, error) { ...@@ -193,7 +193,7 @@ func (s *SocialGithub) FetchPrivateEmail(client *http.Client) (string, error) {
Verified bool `json:"verified"` Verified bool `json:"verified"`
} }
emailsUrl := fmt.Sprintf("https://api.github.com/user/emails") emailsUrl := fmt.Sprintf(s.apiUrl + "/emails")
r, err := client.Get(emailsUrl) r, err := client.Get(emailsUrl)
if err != nil { if err != nil {
return "", err return "", err
...@@ -222,7 +222,7 @@ func (s *SocialGithub) FetchTeamMemberships(client *http.Client) ([]int, error) ...@@ -222,7 +222,7 @@ func (s *SocialGithub) FetchTeamMemberships(client *http.Client) ([]int, error)
Id int `json:"id"` Id int `json:"id"`
} }
membershipUrl := fmt.Sprintf("https://api.github.com/user/teams") membershipUrl := fmt.Sprintf(s.apiUrl + "/teams")
r, err := client.Get(membershipUrl) r, err := client.Get(membershipUrl)
if err != nil { if err != nil {
return nil, err return nil, err
...@@ -249,7 +249,7 @@ func (s *SocialGithub) FetchOrganizations(client *http.Client) ([]string, error) ...@@ -249,7 +249,7 @@ func (s *SocialGithub) FetchOrganizations(client *http.Client) ([]string, error)
Login string `json:"login"` Login string `json:"login"`
} }
url := fmt.Sprintf("https://api.github.com/user/orgs") url := fmt.Sprintf(s.apiUrl + "/orgs")
r, err := client.Get(url) r, err := client.Get(url)
if err != nil { if err != nil {
return nil, err return nil, err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment