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/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 { - 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);