From 6777576948f4faf52da32a9d387b2c971ca5d0f6 Mon Sep 17 00:00:00 2001 From: Vivek Patel Date: Wed, 2 Feb 2022 19:14:04 +0530 Subject: [PATCH] Refactor OIDC provider scope string --- auth/external/goth.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/auth/external/goth.go b/auth/external/goth.go index 6aab3e6d3..823b78448 100644 --- a/auth/external/goth.go +++ b/auth/external/goth.go @@ -52,8 +52,10 @@ func SetupGothProviders(log *zap.Logger, redirectUrl string, ep ...settings.Prov wellKnown := strings.TrimSuffix(pc.IssuerUrl, "/") + WellKnown - scope := strings.Split(pc.Scope, " ") - if len(scope) == 0 { + var scope []string + if len(pc.Scope) > 0 { + scope = strings.Split(pc.Scope, " ") + } else { scope = append(scope, "email") }