Files
romm/backend/handler/auth
Georges-Antoine Assi 494b4b4291 fix(auth): issue a new session id when the session changes identity (#5630)
* fix(auth): issue a new session id when the session changes identity

Logging in (password or OIDC) wrote the user into the session named by
the request cookie, so a session id set in the browser beforehand kept
working for whoever held it after the login. The session middleware now
writes the session under a fresh id whenever its user changes, and
deletes the previous record and closes its sockets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(auth): leave the session cookie alone when a refresh finds it gone

A request still in flight on a session that a concurrent login rotated
away failed its refresh and answered with an expiring session cookie,
which wiped the fresh cookie the login had just set. A failed refresh
now sends no Set-Cookie at all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 08:46:01 -05:00
..