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 @@ -468,6 +468,7 @@ platformDetails: tPlatformDetails, watchedIDs: t.list(t.String), signedIdentityKeysBlob: t.maybe(signedIdentityKeysBlobValidator), + initialNotificationsEncryptedMessage: t.maybe(t.String), }); async function siweAuthResponder( @@ -482,6 +483,7 @@ deviceTokenUpdateRequest, platformDetails, signedIdentityKeysBlob, + initialNotificationsEncryptedMessage, } = request; const calendarQuery = normalizeCalendarQuery(request.calendarQuery); @@ -592,6 +594,7 @@ calendarQuery, socialProof, signedIdentityKeysBlob, + initialNotificationsEncryptedMessage, }); } 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-panel.react.js b/native/account/siwe-panel.react.js --- a/native/account/siwe-panel.react.js +++ b/native/account/siwe-panel.react.js @@ -25,6 +25,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'; import { defaultLandingURLPrefix } from '../utils/url-utils.js'; const commSIWE = `${defaultLandingURLPrefix}/siwe`; @@ -44,6 +45,8 @@ const dispatchActionPromise = useDispatchActionPromise(); const getSIWENonceCall = useServerCall(getSIWENonce); const siweAuthCall = useServerCall(siweAuth); + const callInitialNotificationsEncryptedMessage = + useInitialNotificationsEncryptedMessage(); const logInExtraInfo = useSelector(state => nativeLogInExtraInfoSelector({ @@ -140,15 +143,25 @@ const handleSIWE = React.useCallback( async ({ message, signature }) => { const extraInfo = await logInExtraInfo(); + const initialNotificationsEncryptedMessage = + await callInitialNotificationsEncryptedMessage(); dispatchActionPromise( siweAuthActionTypes, - callSIWE(message, signature, extraInfo), + callSIWE(message, signature, { + ...extraInfo, + initialNotificationsEncryptedMessage, + }), undefined, ({ calendarQuery: extraInfo.calendarQuery }: LogInStartingPayload), ); }, - [logInExtraInfo, dispatchActionPromise, callSIWE], + [ + logInExtraInfo, + dispatchActionPromise, + callSIWE, + callInitialNotificationsEncryptedMessage, + ], ); const closeBottomSheet = bottomSheetRef.current?.close; const { nextMode } = props;