fix(sync): secure encrypted snapshot lifecycle

This commit is contained in:
2026-07-10 06:24:53 -04:00
parent 556c5ff624
commit 540b901fd6
106 changed files with 18026 additions and 3309 deletions
+4
View File
@@ -10,6 +10,7 @@ const BETTER_AUTH_SESSION_QUERY = `
session.id,
session.userId,
session.expiresAt,
session.createdAt,
device_context.device_id AS deviceId
FROM better_auth_session AS session
LEFT JOIN better_auth_session_device_context AS device_context
@@ -22,6 +23,7 @@ export interface AuthContext {
sessionId: string;
tokenHash: string;
expiresAt: string;
createdAt: string;
deviceId?: string;
}
@@ -29,6 +31,7 @@ interface BetterAuthSessionRow extends Record<string, unknown> {
id: unknown;
userId: unknown;
expiresAt: unknown;
createdAt: unknown;
deviceId?: unknown;
}
@@ -111,6 +114,7 @@ async function readBetterAuthSessionContext(
sessionId: subjectId(stringField(row, "id"), "session_id"),
tokenHash,
expiresAt: timestampField(row, "expiresAt"),
createdAt: timestampField(row, "createdAt"),
};
const deviceId = optionalStringField(row, "deviceId");
if (deviceId !== undefined) {