diff --git a/plugin/remote/github/github.go b/plugin/remote/github/github.go index b2b06f460..2451d5455 100644 --- a/plugin/remote/github/github.go +++ b/plugin/remote/github/github.go @@ -81,13 +81,13 @@ func (r *GitHub) Authorize(res http.ResponseWriter, req *http.Request) (*model.L var trans = &oauth.Transport{Config: config} var token, err = trans.Exchange(code) if err != nil { - return nil, err + return nil, fmt.Errorf("Error exchanging token. %s", err) } var client = NewClient(r.API, token.AccessToken) var useremail, errr = GetUserEmail(client) if errr != nil { - return nil, errr + return nil, fmt.Errorf("Error retrieving user or verified email. %s", errr) } var login = new(model.Login) @@ -95,7 +95,6 @@ func (r *GitHub) Authorize(res http.ResponseWriter, req *http.Request) (*model.L login.Access = token.AccessToken login.Login = *useremail.Login login.Email = *useremail.Email - login.Name = *useremail.Email if useremail.Name != nil { login.Name = *useremail.Name } diff --git a/plugin/remote/github/register.go b/plugin/remote/github/register.go index ae4e1e946..6144ff8a6 100644 --- a/plugin/remote/github/register.go +++ b/plugin/remote/github/register.go @@ -44,6 +44,7 @@ func registerGitHubEnterprise() { len(*githubEnterpriseSecret) == 0 { return } + remote.Register( New( *githubEnterpriseURL,