mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-04-07 08:25:23 +02:00
fix: reuse existing OAuth client registrations to prevent client_id mismatch
When using auto-discovered OAuth (DCR), LibreChat calls /register on every flow initiation, getting a new client_id each time. When concurrent connections or reconnections happen, the client_id used during /authorize differs from the one used during /token, causing the server to reject the exchange. Before registering a new client, check if a valid client registration already exists in the database and reuse it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
33ee7dea1e
commit
2fcf8c5419
4 changed files with 261 additions and 9 deletions
|
|
@ -270,6 +270,7 @@ describe('MCPConnectionFactory', () => {
|
|||
{},
|
||||
undefined,
|
||||
undefined,
|
||||
oauthOptions.tokenMethods.findToken,
|
||||
);
|
||||
|
||||
// initFlow must be awaited BEFORE the redirect to guarantee state is stored
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue