aboutsummaryrefslogtreecommitdiffstats
path: root/modules/auth
diff options
context:
space:
mode:
authorDaniil Pankratov <mobigod0@gmail.com>2020-12-24 22:47:17 +0300
committerGitHub <noreply@github.com>2020-12-24 19:47:17 +0000
commit5a94db37ed16b253bf6e43ae6337f3a3c21f6d70 (patch)
tree0f4f27450e423eae290a801a325bbd42c17d887c /modules/auth
parentbdeccc36886d6df4f2a8fce9e5f71e866e9902fc (diff)
downloadgitea-5a94db37ed16b253bf6e43ae6337f3a3c21f6d70.tar.gz
gitea-5a94db37ed16b253bf6e43ae6337f3a3c21f6d70.zip
Fix creating OAuth2 auth source from CLI (#14116)
Fix creation OAuth2 auth source from CLI. Fix #8356 Co-authored-by: Daniil Pankratov <daniil.pankratov@t-systems.com>
Diffstat (limited to 'modules/auth')
-rw-r--r--modules/auth/oauth2/oauth2.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/auth/oauth2/oauth2.go b/modules/auth/oauth2/oauth2.go
index f69bc61d75..e2c97b72f3 100644
--- a/modules/auth/oauth2/oauth2.go
+++ b/modules/auth/oauth2/oauth2.go
@@ -119,6 +119,11 @@ func RemoveProvider(providerName string) {
delete(goth.GetProviders(), providerName)
}
+// ClearProviders clears all OAuth2 providers from the goth lib
+func ClearProviders() {
+ goth.ClearProviders()
+}
+
// 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/" + url.PathEscape(providerName) + "/callback"