mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 08:12:00 +02:00
🔐 fix: Remove OAuth handler cleanup at Connection Change (#9589)
This commit is contained in:
parent
b62ffb533c
commit
133312fb40
1 changed files with 0 additions and 10 deletions
|
@ -220,18 +220,8 @@ export class MCPConnectionFactory {
|
||||||
|
|
||||||
connection.on('oauthRequired', oauthHandler);
|
connection.on('oauthRequired', oauthHandler);
|
||||||
|
|
||||||
/** Handler reference for cleanup when connection state changes to disconnected */
|
|
||||||
const cleanupHandler = (state: string) => {
|
|
||||||
if (state === 'disconnected') {
|
|
||||||
connection.removeListener('oauthRequired', oauthHandler);
|
|
||||||
connection.removeListener('connectionChange', cleanupHandler);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
connection.on('connectionChange', cleanupHandler);
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
connection.removeListener('oauthRequired', oauthHandler);
|
connection.removeListener('oauthRequired', oauthHandler);
|
||||||
connection.removeListener('connectionChange', cleanupHandler);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue