diff options
author | 6543 <6543@obermui.de> | 2020-08-31 00:55:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-30 23:55:19 +0100 |
commit | 87f02d90cf4faef0e6789b29ecf4184595236b13 (patch) | |
tree | 83e7a305642b9bdb35750a3a1e9cc40baf581b97 | |
parent | 21cd7ab812a9c2e39dee23d678590a09ccf29f4e (diff) | |
download | gitea-87f02d90cf4faef0e6789b29ecf4184595236b13.tar.gz gitea-87f02d90cf4faef0e6789b29ecf4184595236b13.zip |
Escape provider name in oauth2 provider redirect (#12650)
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
-rw-r--r-- | modules/auth/oauth2/oauth2.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/auth/oauth2/oauth2.go b/modules/auth/oauth2/oauth2.go index 78be3954ed..2c982e1dca 100644 --- a/modules/auth/oauth2/oauth2.go +++ b/modules/auth/oauth2/oauth2.go @@ -6,6 +6,7 @@ package oauth2 import ( "net/http" + "net/url" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" @@ -119,7 +120,7 @@ func RemoveProvider(providerName string) { // used to create different types of goth providers 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 err error |