Fix actor fields and transactions for API operations as they are recorded to DB.

This commit is contained in:
Leo Vasanko
2026-01-23 20:19:33 +00:00
parent 943bda806d
commit e93578f2e7
7 changed files with 91 additions and 70 deletions
+2 -2
View File
@@ -289,11 +289,11 @@ async def api_logout(request: Request, response: Response, auth=AUTH_COOKIE):
if not auth:
return {"message": "Already logged out"}
try:
await get_session(auth, host=request.headers.get("host"))
s = await get_session(auth, host=request.headers.get("host"))
except ValueError:
return {"message": "Already logged out"}
with suppress(Exception):
db.delete_session(session_key(auth))
db.delete_session(session_key(auth), actor=str(s.user_uuid))
session.clear_session_cookie(response)
return {"message": "Logged out successfully"}