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 @@ -112,12 +112,10 @@ VALUES ${[newUserRow]} `; - const { primaryIdentityPublicKey } = request; const [userViewerData] = await Promise.all([ createNewUserCookie(id, { platformDetails: request.platformDetails, deviceToken, - primaryIdentityPublicKey, }), deleteCookie(viewer.cookieID), dbQuery(newUserQuery), @@ -207,7 +205,6 @@ +calendarQuery: CalendarQuery, +deviceTokenUpdateRequest?: ?DeviceTokenUpdateRequest, +platformDetails: PlatformDetails, - +primaryIdentityPublicKey: ?string, +socialProof: SIWESocialProof, }; // Note: `processSIWEAccountCreation(...)` assumes that the validity of @@ -233,7 +230,6 @@ createNewUserCookie(id, { platformDetails: request.platformDetails, deviceToken, - primaryIdentityPublicKey: request.primaryIdentityPublicKey, socialProof: request.socialProof, }), deleteCookie(viewer.cookieID), 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 @@ -197,6 +197,8 @@ calendarQuery: t.maybe(newEntryQueryInputValidator), deviceTokenUpdateRequest: t.maybe(deviceTokenUpdateRequestInputValidator), platformDetails: tPlatformDetails, + // We include `primaryIdentityPublicKey` to avoid breaking + // old clients, but we no longer do anything with it. primaryIdentityPublicKey: t.maybe(tRegex(primaryIdentityPublicKeyRegex)), }); @@ -214,21 +216,13 @@ +input: any, +userID: string, +calendarQuery: ?CalendarQuery, - +primaryIdentityPublicKey?: ?string, +socialProof?: ?SIWESocialProof, }; async function processSuccessfulLogin( params: ProcessSuccessfulLoginParams, ): Promise { - const { - viewer, - input, - userID, - calendarQuery, - primaryIdentityPublicKey, - socialProof, - } = params; + const { viewer, input, userID, calendarQuery, socialProof } = params; const request: LogInRequest = input; const newServerTime = Date.now(); @@ -239,7 +233,6 @@ createNewUserCookie(userID, { platformDetails: request.platformDetails, deviceToken, - primaryIdentityPublicKey, socialProof, }), fetchNotAcknowledgedPolicies(userID, baseLegalPolicies), @@ -464,6 +457,7 @@ // if it was included. We expect it to be included for native clients, // and we expect it to be EXCLUDED for web clients. const { statement } = siweMessage; + // eslint-disable-next-line no-unused-vars const primaryIdentityPublicKey = statement && isValidSIWEStatementWithPublicKey(statement) ? getPublicKeyFromSIWEStatement(statement) @@ -485,7 +479,6 @@ calendarQuery, deviceTokenUpdateRequest, platformDetails, - primaryIdentityPublicKey, socialProof, }; userID = await processSIWEAccountCreation( @@ -500,7 +493,6 @@ input, userID, calendarQuery, - primaryIdentityPublicKey, socialProof, }); } 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 @@ -648,7 +648,6 @@ type UserCookieCreationParams = { platformDetails: PlatformDetails, deviceToken?: ?string, - primaryIdentityPublicKey?: ?string, socialProof?: ?SIWESocialProof, }; @@ -663,12 +662,7 @@ userID: string, params: UserCookieCreationParams, ): Promise { - const { - platformDetails, - deviceToken, - primaryIdentityPublicKey, - socialProof, - } = params; + const { platformDetails, deviceToken, socialProof } = params; const { platform, ...versions } = platformDetails || defaultPlatformDetails; const versionsString = Object.keys(versions).length > 0 ? JSON.stringify(versions) : null; @@ -690,12 +684,11 @@ time, deviceToken, versionsString, - primaryIdentityPublicKey, JSON.stringify(socialProof), ]; const query = SQL` INSERT INTO cookies(id, hash, user, platform, creation_time, last_used, - device_token, versions, public_key, social_proof) + device_token, versions, social_proof) VALUES ${[cookieRow]} `; await dbQuery(query); diff --git a/lib/types/account-types.js b/lib/types/account-types.js --- a/lib/types/account-types.js +++ b/lib/types/account-types.js @@ -53,7 +53,6 @@ +calendarQuery?: ?CalendarQuery, +deviceTokenUpdateRequest?: ?DeviceTokenUpdateRequest, +platformDetails: PlatformDetails, - +primaryIdentityPublicKey?: ?string, }; export type RegisterResponse = {