LibreChat/api
Danny Avila dd35f42073
🔒 feat: Idempotency Check for OAuth Flow Completion (#10468)
* 🔒 feat: Implement idempotency check for OAuth flow completion

- Added a check to prevent duplicate token exchanges if the OAuth flow has already been completed.
- Updated the OAuth callback route to redirect appropriately when a completed flow is detected.
- Refactored token storage logic to use original flow state credentials instead of updated ones.
- Enhanced tests to cover the new idempotency behavior and ensure correct handling of OAuth flow states.

* chore: add back scope for logging

* refactor: Add isFlowStale method to FlowStateManager for stale flow detection

- Implemented a new method to check if a flow is stale based on its age and status.
- Updated MCPConnectionFactory to utilize the isFlowStale method for cleaning up stale OAuth flows.
- Enhanced logging to provide more informative messages regarding flow status and age during cleanup.

* test: Add unit tests for isFlowStale method in FlowStateManager

- Implemented comprehensive tests for the isFlowStale method to verify its behavior across various flow statuses (PENDING, COMPLETED, FAILED) and age thresholds.
- Ensured correct handling of edge cases, including flows with missing timestamps and custom stale thresholds.
- Enhanced test coverage to validate the logic for determining flow staleness based on createdAt, completedAt, and failedAt timestamps.
2025-11-12 08:44:45 -05:00
..
app 📂 refactor: Cleanup File Filtering Logic, Improve Validation (#10414) 2025-11-10 19:05:30 -05:00
cache 🔄 refactor: Migrate Cache Logic to TypeScript (#9771) 2025-10-02 09:33:58 -04:00
config 📜 feat: Configurable Debug Message Length for Logs (#10447) 2025-11-10 21:40:37 -05:00
db 🔀 refactor: Only Cleanup Meili Sync if actually Synced 2025-10-05 22:41:40 -04:00
lib/utils 🏗️ refactor: Extract DB layers to data-schemas for shared use (#7650) 2025-05-30 22:18:13 -04:00
models 🏷️ fix: Add user ID to MCP tools cache keys (#10201) 2025-10-30 17:09:56 -04:00
server 🔒 feat: Idempotency Check for OAuth Flow Completion (#10468) 2025-11-12 08:44:45 -05:00
strategies 🛂 feat: Social Login by Provider ID First then Email (#10358) 2025-11-05 09:20:35 -05:00
test 🔄 refactor: Optimize MCP Tool Initialization 2025-09-21 20:31:28 -04:00
utils 🧮 feat: Enhance Model Pricing Coverage and Pattern Matching (#10173) 2025-10-19 15:23:27 +02:00
jest.config.js 🏪 feat: Agent Marketplace 2025-08-13 16:24:18 -04:00
jsconfig.json feat(api): initial Redis support; fix(SearchBar): proper debounce (#1039) 2023-10-11 17:05:47 -04:00
package.json 🧰 fix: Unprocessed Tool Calls Edge Case (#10440) 2025-11-10 17:12:06 -05:00
typedefs.js 📦 chore: Remove @langchain/community & Related Legacy Code (#10375) 2025-11-05 19:24:36 -05:00