We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 48eb4cb commit a209b8eCopy full SHA for a209b8e
1 file changed
pkg/http/middleware/scope_challenge.go
@@ -97,7 +97,7 @@ func WithScopeChallenge(oauthCfg *oauth.Config, scopeFetcher scopes.FetcherInter
97
// Get OAuth scopes for Token. First check if scopes are already in context, then fetch from GitHub if not present.
98
// This allows Remote Server to pass scope info to avoid redundant GitHub API calls.
99
activeScopes, ok := ghcontext.GetTokenScopes(ctx)
100
- if !ok {
+ if !ok || (len(activeScopes) == 0 && tokenInfo.Token != "") {
101
activeScopes, err = scopeFetcher.FetchTokenScopes(ctx, tokenInfo.Token)
102
if err != nil {
103
next.ServeHTTP(w, r)
0 commit comments