mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-23 02:11:01 +00:00
Put values from settings into handler/auth.go
This commit is contained in:
parent
7208d95a76
commit
6c9ff00f99
1 changed files with 3 additions and 2 deletions
|
@ -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,
|
||||
}
|
||||
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue