B1: React Query deeper adoption (P1–P3) #86

Closed
null wants to merge 340 commits from branch/b1-react-query into main
1 changed files with 9 additions and 5 deletions
Showing only changes of commit 4b86898bc7 - Show all commits

View File

@ -128,11 +128,15 @@ function rotateSessionId(oldSessionId, userId) {
.toISOString().slice(0, 19).replace('T', ' ');
// Delete old session and create new one atomically
db.transaction(() => {
db.prepare('DELETE FROM sessions WHERE id = ?').run(oldSessionId);
db.prepare('INSERT INTO sessions (id, user_id, expires_at) VALUES (?, ?, ?)')
.run(newSessionId, userId, expiresAt);
})();
try {
db.transaction(() => {
db.prepare('DELETE FROM sessions WHERE id = ?').run(oldSessionId);
db.prepare('INSERT INTO sessions (id, user_id, expires_at) VALUES (?, ?, ?)')
.run(newSessionId, userId, expiresAt);
})();
} catch {
return null;
}
return newSessionId;
}