|
|
@ -6,6 +6,7 @@ package oauth2 |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"net/http" |
|
|
|
"net/http" |
|
|
|
|
|
|
|
"net/url" |
|
|
|
|
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
@ -119,7 +120,7 @@ func RemoveProvider(providerName string) { |
|
|
|
|
|
|
|
|
|
|
|
// used to create different types of goth providers
|
|
|
|
// used to create different types of goth providers
|
|
|
|
func createProvider(providerName, providerType, clientID, clientSecret, openIDConnectAutoDiscoveryURL string, customURLMapping *CustomURLMapping) (goth.Provider, error) { |
|
|
|
func createProvider(providerName, providerType, clientID, clientSecret, openIDConnectAutoDiscoveryURL string, customURLMapping *CustomURLMapping) (goth.Provider, error) { |
|
|
|
callbackURL := setting.AppURL + "user/oauth2/" + providerName + "/callback" |
|
|
|
callbackURL := setting.AppURL + "user/oauth2/" + url.PathEscape(providerName) + "/callback" |
|
|
|
|
|
|
|
|
|
|
|
var provider goth.Provider |
|
|
|
var provider goth.Provider |
|
|
|
var err error |
|
|
|
var err error |
|
|
|