fix: guard findToken with deleteTokens check in blocking OAuth path

Match the returnOnOAuth path's defense-in-depth: only enable client
registration reuse when deleteTokens is also available, ensuring
cleanup is possible if the reused client turns out to be stale.
This commit is contained in:
Danny Avila 2026-04-03 21:14:45 -04:00
parent 2b09879faf
commit b5231547bb

View file

@ -664,7 +664,7 @@ export class MCPConnectionFactory {
this.serverConfig.oauth_headers ?? {},
this.serverConfig.oauth,
this.allowedDomains,
this.tokenMethods?.findToken,
this.tokenMethods?.deleteTokens ? this.tokenMethods.findToken : undefined,
);
reusedStoredClient = flowMetadata.reusedStoredClient === true;