Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3751199
D6134.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D6134.diff
View Options
diff --git a/keyserver/src/creators/account-creator.js b/keyserver/src/creators/account-creator.js
--- a/keyserver/src/creators/account-creator.js
+++ b/keyserver/src/creators/account-creator.js
@@ -236,6 +236,7 @@
createNewUserCookie(id, {
platformDetails: request.platformDetails,
deviceToken,
+ primaryIdentityPublicKey: request.primaryIdentityPublicKey,
}),
deleteCookie(viewer.cookieID),
dbQuery(newUserQuery),
diff --git a/keyserver/src/responders/user-responders.js b/keyserver/src/responders/user-responders.js
--- a/keyserver/src/responders/user-responders.js
+++ b/keyserver/src/responders/user-responders.js
@@ -203,6 +203,7 @@
input: any,
userID: string,
calendarQuery: ?CalendarQuery,
+ primaryIdentityPublicKey?: ?string,
): Promise<LogInResponse> {
const request: LogInRequest = input;
const newServerTime = Date.now();
@@ -213,6 +214,7 @@
createNewUserCookie(userID, {
platformDetails: request.platformDetails,
deviceToken,
+ primaryIdentityPublicKey,
}),
deleteCookie(viewer.cookieID),
]);
@@ -398,7 +400,13 @@
}
// 6. Complete login with call to `processSuccessfulLogin(...)`.
- return await processSuccessfulLogin(viewer, input, userID, calendarQuery);
+ return await processSuccessfulLogin(
+ viewer,
+ input,
+ userID,
+ calendarQuery,
+ primaryIdentityPublicKey,
+ );
}
const updatePasswordRequestInputValidator = tShape({
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
@@ -644,6 +644,7 @@
type UserCookieCreationParams = {
platformDetails: PlatformDetails,
deviceToken?: ?string,
+ primaryIdentityPublicKey?: ?string,
};
// The result of this function should never be passed directly to the Viewer
@@ -657,7 +658,7 @@
userID: string,
params: UserCookieCreationParams,
): Promise<UserViewerData> {
- const { platformDetails, deviceToken } = params;
+ const { platformDetails, deviceToken, primaryIdentityPublicKey } = params;
const { platform, ...versions } = platformDetails || defaultPlatformDetails;
const versionsString =
Object.keys(versions).length > 0 ? JSON.stringify(versions) : null;
@@ -679,10 +680,11 @@
time,
deviceToken,
versionsString,
+ primaryIdentityPublicKey,
];
const query = SQL`
INSERT INTO cookies(id, hash, user, platform, creation_time, last_used,
- device_token, versions)
+ device_token, versions, public_key)
VALUES ${[cookieRow]}
`;
await dbQuery(query);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 10, 11:27 PM (19 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2856691
Default Alt Text
D6134.diff (2 KB)
Attached To
Mode
D6134: [keyserver] Store `primaryIdentityPublicKey` in `public_key` column of `cookies` table
Attached
Detach File
Event Timeline
Log In to Comment