Skip to content
Permalink
Browse files
Fix bug when refresh gitea access token
	When the URI has extra '/' in DRONE_GITEA_SERVER, the drone
	will not pull the repo since it cannot refresh the access token.
	The log in gitea shows the drone try to access '//login/oauth/access_token'

	Related to commit 5414bb7
  • Loading branch information
cmj0121 committed Feb 14, 2020
1 parent 1ddf796 commit 3e74e30845d1d0d03df80cf6babe7a2bc9a5ad6a
Showing 1 changed file with 1 addition and 1 deletion.
@@ -169,7 +169,7 @@ func provideRefresher(config config.Config) *oauth2.Refresher {
return &oauth2.Refresher{
ClientID: config.Gitea.ClientID,
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(),
Client: defaultClient(config.Gitea.SkipVerify),
}

0 comments on commit 3e74e30

Please sign in to comment.