use switch case
This commit is contained in:
parent
9ced52ab50
commit
b7fc433b31
1 changed files with 3 additions and 3 deletions
|
@ -164,15 +164,15 @@ func provideStashLogin(config config.Config) login.Middleware {
|
|||
// provideRefresher is a Wire provider function that returns
|
||||
// an oauth token refresher for Bitbucket.
|
||||
func provideRefresher(config config.Config) *oauth2.Refresher {
|
||||
if config.Bitbucket.ClientID != "" {
|
||||
switch {
|
||||
case config.Bitbucket.ClientID != "":
|
||||
return &oauth2.Refresher{
|
||||
ClientID: config.Bitbucket.ClientID,
|
||||
ClientSecret: config.Bitbucket.ClientSecret,
|
||||
Endpoint: "https://bitbucket.org/site/oauth2/access_token",
|
||||
Source: oauth2.ContextTokenSource(),
|
||||
}
|
||||
}
|
||||
if config.Gitea.ClientID != "" {
|
||||
case config.Gitea.Server != "":
|
||||
return &oauth2.Refresher{
|
||||
ClientID: config.Gitea.ClientID,
|
||||
ClientSecret: config.Gitea.ClientSecret,
|
||||
|
|
Loading…
Reference in a new issue