Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Enterprise Support #23

Closed
wants to merge 8 commits into from
Prev Previous commit
Next Next commit
Put values from settings into handler/auth.go
  • Loading branch information
floatdrop committed Feb 14, 2014
commit b7a9c7f8459356dabfb44417158faab6ea7c265d
5 changes: 3 additions & 2 deletions pkg/handler/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func LinkGithub(w http.ResponseWriter, r *http.Request, u *User) error {
// github OAuth2 Data
var oauth = oauth2.Client{
RedirectURL: settings.URL().String() + "/auth/login/github",
AccessTokenURL: "https://github.com/login/oauth/access_token",
AuthorizationURL: "https://github.com/login/oauth/authorize",
AccessTokenURL: "https://" + settings.GitHubDomain + "/login/oauth/access_token",
AuthorizationURL: "https://" + settings.GitHubDomain + "/login/oauth/authorize",
ClientId: settings.GitHubKey,
ClientSecret: settings.GitHubSecret,
}
Expand All @@ -72,6 +72,7 @@ func LinkGithub(w http.ResponseWriter, r *http.Request, u *User) error {

// create the client
client := github.New(token.AccessToken)
client.ApiUrl = settings.GitHubApiUrl

// get the user information
githubUser, err := client.Users.Current()
Expand Down