diff options
author | zeripath <art27@cantab.net> | 2020-08-30 23:55:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-30 23:55:01 +0100 |
commit | 58f57b3b6cb47cad23a94f92c625d0ac5832c350 (patch) | |
tree | 36c4680eb6daed685b5423317bf0898326df9587 /modules | |
parent | 9bc69ff26eeebaf3b622d62d18c757ff1f401dda (diff) | |
download | gitea-58f57b3b6cb47cad23a94f92c625d0ac5832c350.tar.gz gitea-58f57b3b6cb47cad23a94f92c625d0ac5832c350.zip |
Escape provider name in oauth2 provider redirect (#12648)
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules')
-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 |