LibreChat/api
Danny Avila f1a21764f3
🧺 fix: Discard Stale Session Tokens at OpenID Login (#15668)
With `OPENID_REUSE_TOKENS=true`, `sendOpenIDAuthResponse` compares the
incoming token set against `req.session.openidTokens`. Passport runs with
`session: false`, so the Express session is never regenerated at login and a
token set from an earlier authentication survives there. Its refresh token
differs from the one the IdP just issued, which the advanced-session check
reads as "a concurrent refresh already advanced the session": the fresh IdP
tokens are discarded and the stale set is republished. When that stale
access token has already expired, the completed flight's TTL clamps to 1ms
and the publication assertion fails with "OpenID refresh result is no longer
available for publication", which fails every login for as long as the stale
session lives.

The advanced-session comparison exists for refresh races and has no business
at a fresh authorization-code login. The login controller now asks the
publication service to discard whatever the session holds, and the service
does so after its own session reload so the store cannot resurrect the
stale set. Refresh callers are unchanged.

Fixes #15648
2026-09-06 15:07:08 -04:00
..
app 🩻 feat(insights): Scope Insights to Authorized Agents (#15549) 2026-09-04 20:16:58 -04:00
cache 🚰 fix: Throttle Shared Link Reads and Aggregate Audit Findings (#15605) 2026-09-04 12:38:34 -04:00
config 🫆 chore: Remove Published Credential Defaults (#14680) 2026-08-07 07:25:05 -04:00
db 🐇 refactor: Decouple Meilisearch From Document Saves (#15109) 2026-08-21 22:26:44 -04:00
models 🧩 fix: Preserve Deployment Skill IDs on Agents (#14368) 2026-07-21 19:44:27 -04:00
server 🧺 fix: Discard Stale Session Tokens at OpenID Login (#15668) 2026-09-06 15:07:08 -04:00
strategies 🔐 fix: Keep OpenID Metadata Out of Logs and Traces (#15470) 2026-09-01 13:22:12 -04:00
test 🔐 fix: Redirect OAuth Browser Navigations Instead of Rendering JSON (#15440) 2026-08-31 21:13:47 -04:00
utils ⚡ feat: Add Gemini 3.8 Flash Support (#15519) 2026-09-02 15:06:40 -04:00
jest.config.js 🎨 feat: Theme-Adaptive SVG Support for Custom MCP and Group Icons (#13817) 2026-09-04 10:49:43 -04:00
jsconfig.json
package.json 🎨 feat: Theme-Adaptive SVG Support for Custom MCP and Group Icons (#13817) 2026-09-04 10:49:43 -04:00
typedefs.js 🛂 test: Cover Tool Approval Workflows End to End (#14427) 2026-07-26 21:58:25 -04:00