Prevent revoked session refills and escape proxy error identifiers

This commit is contained in:
Artyom
2026-11-06 01:49:41 +03:00
parent da2f392442
commit 2af24d7762
8 changed files with 312 additions and 28 deletions
@@ -166,10 +166,12 @@ class PostgresSessionDirectory:
async with self._database.session() as session:
row = (
await session.execute(
select(SessionRow).where(
select(SessionRow)
.where(
SessionRow.token_hash == token_hash,
SessionRow.expires_at > now,
)
.with_for_update(read=True, key_share=True)
)
).scalar_one_or_none()
if row is None: