Page MenuHomePhabricator

D7050.id23728.diff
No OneTemporary

D7050.id23728.diff

diff --git a/keyserver/src/session/cookies.js b/keyserver/src/session/cookies.js
--- a/keyserver/src/session/cookies.js
+++ b/keyserver/src/session/cookies.js
@@ -807,6 +807,22 @@
await dbQuery(query);
}
+// Returns `true` if row with `id = cookieID` exists AND
+// `signed_identity_keys` is `NULL`. Otherwise, returns `false`.
+async function isCookieMissingSignedIdentityKeysBlob(
+ cookieID: string,
+): Promise<boolean> {
+ const query = SQL`
+ SELECT signed_identity_keys
+ FROM cookies
+ WHERE id = ${cookieID}
+ `;
+ const [queryResult] = await dbQuery(query);
+ return (
+ queryResult.length === 1 && queryResult[0].signed_identity_keys === null
+ );
+}
+
async function setCookiePlatform(
viewer: Viewer,
platform: Platform,
@@ -855,6 +871,7 @@
addCookieToJSONResponse,
addCookieToHomeResponse,
setCookieSignedIdentityKeysBlob,
+ isCookieMissingSignedIdentityKeysBlob,
setCookiePlatform,
setCookiePlatformDetails,
};

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 12:25 AM (21 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2581142
Default Alt Text
D7050.id23728.diff (976 B)

Event Timeline