Auth: use the scope parameter instead of a hardcoded value in appendUniqueScope() (#84053)

use the scope parameter instead of a hardcoded value
This commit is contained in:
Mihai Doarna
2024-03-07 12:08:58 +02:00
committed by GitHub
parent b8d8662bd9
commit beea7d1c2b

View File

@@ -197,7 +197,7 @@ func CreateOAuthInfoFromKeyValues(settingsKV map[string]any) (*social.OAuthInfo,
}
func appendUniqueScope(config *oauth2.Config, scope string) {
if !slices.Contains(config.Scopes, social.OfflineAccessScope) {
config.Scopes = append(config.Scopes, social.OfflineAccessScope)
if !slices.Contains(config.Scopes, scope) {
config.Scopes = append(config.Scopes, scope)
}
}