LibreChat/api/server
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
..
controllers 📂 refactor: Cleanup File Filtering Logic, Improve Validation (#10414) 2025-11-10 19:05:30 -05:00
middleware 🔄 refactor: Migrate Cache Logic to TypeScript (#9771) 2025-10-02 09:33:58 -04:00
routes 🔒 feat: Idempotency Check for OAuth Flow Completion (#10468) 2025-11-12 08:44:45 -05:00
services Merge commit from fork 2025-11-11 14:14:55 -05:00
utils ⚖️ fix: Add Configurable File Size Cap for Conversation Imports (#10012) 2025-10-07 14:47:21 -04:00
cleanup.js 🧰 fix: Unprocessed Tool Calls Edge Case (#10440) 2025-11-10 17:12:06 -05:00
index.js 🧰 fix: Unprocessed Tool Calls Edge Case (#10440) 2025-11-10 17:12:06 -05:00
index.spec.js 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04:00
socialLogins.js ⚙️ refactor: Only register OpenID Strategy if Config Succeeded (#9094) 2025-08-16 14:49:03 -04:00