Files
romm/backend/handler/auth
Sam Dornan 2140d899cb fix(security): move session revocation behind the auth handler
Addresses the two open review findings on the credential-change path.

The endpoint was sequencing two Redis revocations around the database
write itself, reaching past the handler layer into the session
middleware. The whole sequence now lives in `auth_handler`, so the
endpoint validates, calls a handler and serializes, as the rest of the
backend does.

The second revocation runs after the write has committed, so raising
from it reported a failed change that had in fact succeeded, and an
operator could not tell the two apart. It is now logged instead, naming
the account and warning that a session created during the update may
still be live. The first revocation still raises, because it has a write
to abort.

`set_user_new_password` (the forgot-password path) goes through the same
helper, which gives it the pre-write pass it did not have: an
unreachable Redis there used to change the password and leave the
account's sessions live.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SPpv6W2ygP9tQ61fTQxdYp
2026-09-20 17:11:00 +00:00
..
2024-12-12 17:37:30 -05:00