File tree Expand file tree Collapse file tree
packages/web/src/ee/features/chat/mcp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,8 +54,7 @@ export function buildMcpOAuthScopeEntries({
5454
5555 return normalizedAvailableOAuthScopes . map ( ( scope ) => ( {
5656 scope,
57- // offline_access is enabled by default because all clients declare the refresh_token
58- // grant; an admin who leaves it unticked would produce a broken authorization request.
57+ // Force-enabled regardless of admin selection — see OFFLINE_ACCESS_SCOPE.
5958 enabled : scope === OFFLINE_ACCESS_SCOPE || requestedScopeSet . has ( scope ) ,
6059 } ) ) ;
6160}
Original file line number Diff line number Diff line change @@ -113,12 +113,10 @@ export class PrismaOAuthClientProvider implements OAuthClientProvider {
113113 this . userId = userId ;
114114 this . callbackUrl = callbackUrl ;
115115 this . callbackReturnTo = callbackReturnTo ;
116- // offline_access is always injected because every client declares the refresh_token grant
117- // and providers such as Atlassian reject /authorize when the grant is declared but
118- // offline_access is absent. We inject unconditionally rather than checking the provider's
119- // advertised scopes because oauthScopesSupported is not plumbed through to this constructor;
120- // the tradeoff (a benign unknown-scope rejection on strict providers) is the same as the
121- // existing behaviour of always declaring refresh_token.
116+ // Always inject offline_access (see OFFLINE_ACCESS_SCOPE). We do so unconditionally rather
117+ // than checking the provider's advertised scopes because oauthScopesSupported is not plumbed
118+ // through to this constructor; the tradeoff (a benign unknown-scope rejection on strict
119+ // providers) is the same as the existing behaviour of always declaring refresh_token.
122120 this . requestedOAuthScopes = normalizeMcpRequestedOAuthScopes ( [
123121 ...requestedOAuthScopes ,
124122 OFFLINE_ACCESS_SCOPE ,
You can’t perform that action at this time.
0 commit comments