Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3345112
D9125.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
989 B
Referenced Files
None
Subscribers
None
D9125.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D9125: [keyserver] fix fetching identity info
Attached
Detach File
Event Timeline
Log In to Comment