🔐 fix: persist new MCP oauth tokens properly (#10439)

* fix: re-fetch OAuth flow state after completeOAuthFlow

* test: add tests for MCP OAuth flow state bugs
This commit is contained in:
Sean McGrath 2025-11-11 13:51:20 +13:00 committed by GitHub
parent 2524d33362
commit b443254151
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 127 additions and 8 deletions

View file

@ -217,7 +217,11 @@ export class MCPTokenStorage {
}
}
logger.debug(`${logPrefix} Stored OAuth tokens`);
logger.debug(`${logPrefix} Stored OAuth tokens`, {
client_id: clientInfo?.client_id,
has_refresh_token: !!tokens.refresh_token,
expires_at: 'expires_at' in tokens ? tokens.expires_at : 'N/A',
});
} catch (error) {
const logPrefix = this.getLogPrefix(userId, serverName);
logger.error(`${logPrefix} Failed to store tokens`, error);