Page MenuHomePhabricator

D9125.diff
No OneTemporary

D9125.diff

diff --git a/keyserver/src/user/identity.js b/keyserver/src/user/identity.js
--- a/keyserver/src/user/identity.js
+++ b/keyserver/src/user/identity.js
@@ -13,16 +13,25 @@
async function fetchIdentityInfo(): Promise<?IdentityInfo> {
const versionQuery = SQL`
- SELECT data
+ SELECT name, data
FROM metadata
WHERE name IN (${userIDMetadataKey}, ${accessTokenMetadataKey})
`;
- const [[userID, accessToken]] = await dbQuery(versionQuery);
+ const [result] = await dbQuery(versionQuery);
+ let userID, accessToken;
+ for (const row of result) {
+ if (row.name === userIDMetadataKey) {
+ userID = row.data;
+ } else if (row.name === accessTokenMetadataKey) {
+ accessToken = row.data;
+ }
+ }
+
if (!userID || !accessToken) {
return null;
}
- return { userId: userID.data, accessToken: accessToken.data };
+ return { userId: userID, accessToken };
}
function saveIdentityInfo(userInfo: IdentityInfo): Promise<QueryResults> {

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 5:31 AM (13 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2569102
Default Alt Text
D9125.diff (989 B)

Event Timeline