Remove address variable - to make Locations use host value from config instead.

This commit is contained in:
gytisrepecka 2020-04-17 17:12:06 +03:00
parent 658310bc24
commit 0e1459c6b2
No known key found for this signature in database
GPG Key ID: BE7648906D706003
1 changed files with 3 additions and 4 deletions

View File

@ -222,13 +222,12 @@ func configureGiteaOauth(parentHandler *Handler, r *mux.Router, app *App) {
callbackLocation = app.Config().GiteaOauth.CallbackProxy
}
address := config.OrDefaultString(app.Config().GiteaOauth.Host, giteaHost)
oauthClient := giteaOauthClient{
ClientID: app.Config().GiteaOauth.ClientID,
ClientSecret: app.Config().GiteaOauth.ClientSecret,
ExchangeLocation: address + "/login/oauth/access_token",
InspectLocation: address + "/api/v1/user",
AuthLocation: address + "/login/oauth/authorize",
ExchangeLocation: app.Config().GiteaOauth.Host + "/login/oauth/access_token",
InspectLocation: app.Config().GiteaOauth.Host + "/api/v1/user",
AuthLocation: app.Config().GiteaOauth.Host + "/login/oauth/authorize",
HttpClient: config.DefaultHTTPClient(),
CallbackLocation: callbackLocation,
}