db-postgres.ts query() returns T[] directly, not a QueryResult object. result.rows was undefined, causing the session lookup to always return null and redirect to login even with a valid session token. Co-authored-by: Cursor <cursoragent@cursor.com>