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 @@ -580,6 +580,7 @@ platformDetails: tPlatformDetails, watchedIDs: t.list(tID), signedIdentityKeysBlob: t.maybe(signedIdentityKeysBlobValidator), + initialNotificationsEncryptedMessage: t.maybe(t.String), }); async function siweAuthResponder( @@ -598,6 +599,7 @@ deviceTokenUpdateRequest, platformDetails, signedIdentityKeysBlob, + initialNotificationsEncryptedMessage, } = request; const calendarQuery = normalizeCalendarQuery(request.calendarQuery); @@ -708,6 +710,7 @@ calendarQuery, socialProof, signedIdentityKeysBlob, + initialNotificationsEncryptedMessage, }); return validateOutput( viewer.platformDetails, diff --git a/lib/types/siwe-types.js b/lib/types/siwe-types.js --- a/lib/types/siwe-types.js +++ b/lib/types/siwe-types.js @@ -20,6 +20,7 @@ +platformDetails: PlatformDetails, +watchedIDs: $ReadOnlyArray, +signedIdentityKeysBlob?: ?SignedIdentityKeysBlob, + +initialNotificationsEncryptedMessage?: string, }; export type SIWEAuthServerCall = { diff --git a/native/account/siwe-hooks.js b/native/account/siwe-hooks.js --- a/native/account/siwe-hooks.js +++ b/native/account/siwe-hooks.js @@ -12,6 +12,7 @@ import { NavContext } from '../navigation/navigation-context.js'; import { useSelector } from '../redux/redux-utils.js'; import { nativeLogInExtraInfoSelector } from '../selectors/account-selectors.js'; +import { useInitialNotificationsEncryptedMessage } from '../utils/crypto-utils.js'; type SIWEServerCallParams = { +message: string, @@ -52,19 +53,32 @@ }), ); + const getInitialNotificationsEncryptedMessage = + useInitialNotificationsEncryptedMessage(); + const dispatchActionPromise = useDispatchActionPromise(); return React.useCallback( async ({ message, signature }) => { const extraInfo = await logInExtraInfo(); + const initialNotificationsEncryptedMessage = + await getInitialNotificationsEncryptedMessage(); dispatchActionPromise( siweAuthActionTypes, - callSIWE(message, signature, extraInfo), + callSIWE(message, signature, { + ...extraInfo, + initialNotificationsEncryptedMessage, + }), undefined, ({ calendarQuery: extraInfo.calendarQuery }: LogInStartingPayload), ); }, - [logInExtraInfo, dispatchActionPromise, callSIWE], + [ + logInExtraInfo, + dispatchActionPromise, + callSIWE, + getInitialNotificationsEncryptedMessage, + ], ); }