Skip to content

Commit 20bc22e

Browse files
committed
fix suggestions by coderabbit
1 parent 8beec21 commit 20bc22e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

config.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,12 @@ func FromEnv() (*Config, error) {
318318
}
319319

320320
jwtSecret := getEnv("JWT_SECRET", "")
321-
scopes := strings.Split(getEnv("OIDC_SCOPES", ""), " ")
321+
322+
scopes := []string{}
323+
scopesEnv := getEnv("OIDC_SCOPES", "")
324+
if scopesEnv != "" {
325+
scopes = strings.Split(scopesEnv, " ")
326+
}
322327

323328
return NewConfigBuilder().
324329
WithMode(getEnv("OAUTH_MODE", "")).

metadata.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func (h *OAuth2Handler) GetAuthorizationServerMetadata() map[string]interface{}
282282
"grant_types_supported": []string{"authorization_code"},
283283
"token_endpoint_auth_methods_supported": []string{"none"},
284284
"code_challenge_methods_supported": []string{"plain", "S256"},
285-
"scopes_supported": []string{"openid", "profile", "email"},
285+
"scopes_supported": h.config.Scopes,
286286
}
287287

288288
// Add provider-specific endpoints

0 commit comments

Comments
 (0)