Skip to content

Commit

Permalink
Escape provider name in oauth2 provider redirect (go-gitea#12650)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Andrew Thornton <[email protected]>
  • Loading branch information
6543 and zeripath authored Aug 30, 2020
1 parent 21cd7ab commit 87f02d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/auth/oauth2/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package oauth2

import (
"net/http"
"net/url"

"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 87f02d9

Please sign in to comment.