mirror of
https://github.com/harness/drone.git
synced 2025-05-11 06:30:06 +08:00
Merge pull request #2920 from cmj0121/master
Fix bug when refresh gitea access token
This commit is contained in:
commit
6b6ea7395e
@ -24,6 +24,7 @@ import (
|
|||||||
"github.com/drone/go-login/login/gogs"
|
"github.com/drone/go-login/login/gogs"
|
||||||
"github.com/drone/go-login/login/stash"
|
"github.com/drone/go-login/login/stash"
|
||||||
"github.com/drone/go-scm/scm/transport/oauth2"
|
"github.com/drone/go-scm/scm/transport/oauth2"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/google/wire"
|
"github.com/google/wire"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
@ -169,7 +170,7 @@ func provideRefresher(config config.Config) *oauth2.Refresher {
|
|||||||
return &oauth2.Refresher{
|
return &oauth2.Refresher{
|
||||||
ClientID: config.Gitea.ClientID,
|
ClientID: config.Gitea.ClientID,
|
||||||
ClientSecret: config.Gitea.ClientSecret,
|
ClientSecret: config.Gitea.ClientSecret,
|
||||||
Endpoint: config.Gitea.Server + "/login/oauth/access_token",
|
Endpoint: strings.TrimSuffix(config.Gitea.Server, "/") + "/login/oauth/access_token",
|
||||||
Source: oauth2.ContextTokenSource(),
|
Source: oauth2.ContextTokenSource(),
|
||||||
Client: defaultClient(config.Gitea.SkipVerify),
|
Client: defaultClient(config.Gitea.SkipVerify),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user