mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-04-07 00:15:23 +02:00
fix: require deleteTokens for client reuse, add missing import in MCP.js
Client registration reuse without cleanup capability creates a permanent failure loop: if the reused client is stale, the code detects the rejection but cannot clear the stored registration because deleteTokens is missing, so every retry reuses the same broken client_id. - MCPConnectionFactory: only pass findToken to initiateOAuthFlow when deleteTokens is also available, ensuring reuse is only enabled when recovery is possible - api/server/services/MCP.js: add deleteTokens to the tokenMethods object (was the only MCP call site missing it)
This commit is contained in:
parent
c39fffedf7
commit
a78b8db3e8
2 changed files with 3 additions and 2 deletions
|
|
@ -23,7 +23,7 @@ const {
|
|||
getFlowStateManager,
|
||||
getMCPManager,
|
||||
} = require('~/config');
|
||||
const { findToken, createToken, updateToken } = require('~/models');
|
||||
const { findToken, createToken, updateToken, deleteTokens } = require('~/models');
|
||||
const { getGraphApiToken } = require('./GraphTokenService');
|
||||
const { reinitMCPServer } = require('./Tools/mcp');
|
||||
const { getAppConfig } = require('./Config');
|
||||
|
|
@ -644,6 +644,7 @@ function createToolInstance({
|
|||
findToken,
|
||||
createToken,
|
||||
updateToken,
|
||||
deleteTokens,
|
||||
},
|
||||
oauthStart,
|
||||
oauthEnd,
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ export class MCPConnectionFactory {
|
|||
config?.oauth_headers ?? {},
|
||||
config?.oauth,
|
||||
this.allowedDomains,
|
||||
this.tokenMethods?.findToken,
|
||||
this.tokenMethods?.deleteTokens ? this.tokenMethods.findToken : undefined,
|
||||
);
|
||||
|
||||
if (existingFlow) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue