Page MenuHomePhabricator

D6881.diff
No OneTemporary

D6881.diff

diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js
--- a/lib/actions/user-actions.js
+++ b/lib/actions/user-actions.js
@@ -120,7 +120,13 @@
): ((logInInfo: LogInInfo) => Promise<LogInResult>) =>
async logInInfo => {
const watchedIDs = threadWatcher.getWatchedIDs();
- const { logInActionSource, ...restLogInInfo } = logInInfo;
+ const {
+ logInActionSource,
+ primaryIdentityPublicKeys,
+ notificationIdentityPublicKeys,
+ ...restLogInInfo
+ } = logInInfo;
+
const response = await callServerEndpoint(
'log_in',
{
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
@@ -1,5 +1,6 @@
// @flow
+import type { OLMIdentityKeys } from './crypto-types.js';
import type { PlatformDetails } from './device-types.js';
import type {
CalendarQuery,
@@ -104,6 +105,8 @@
+calendarQuery: CalendarQuery,
+deviceTokenUpdateRequest?: ?DeviceTokenUpdateRequest,
+primaryIdentityPublicKey?: string,
+ +primaryIdentityPublicKeys?: ?OLMIdentityKeys,
+ +notificationIdentityPublicKeys?: ?OLMIdentityKeys,
};
export type LogInInfo = {
diff --git a/web/account/traditional-login-form.react.js b/web/account/traditional-login-form.react.js
--- a/web/account/traditional-login-form.react.js
+++ b/web/account/traditional-login-form.react.js
@@ -41,6 +41,9 @@
const primaryIdentityPublicKeys: ?OLMIdentityKeys = useSelector(
state => state.cryptoStore.primaryIdentityKeys,
);
+ const notificationIdentityPublicKeys: ?OLMIdentityKeys = useSelector(
+ state => state.cryptoStore.notificationIdentityKeys,
+ );
const usernameInputRef = React.useRef();
React.useEffect(() => {
@@ -72,12 +75,18 @@
primaryIdentityPublicKeys,
'primaryIdentityPublicKeys must be set in logInAction',
);
+ invariant(
+ notificationIdentityPublicKeys,
+ 'notificationIdentityPublicKeys must be set in logInAction',
+ );
const result = await callLogIn({
...extraInfo,
username,
password,
logInActionSource: logInActionSources.logInFromWebForm,
primaryIdentityPublicKey: primaryIdentityPublicKeys.ed25519,
+ primaryIdentityPublicKeys,
+ notificationIdentityPublicKeys,
});
modalContext.popModal();
return result;
@@ -93,7 +102,14 @@
throw e;
}
},
- [callLogIn, modalContext, password, primaryIdentityPublicKeys, username],
+ [
+ callLogIn,
+ modalContext,
+ notificationIdentityPublicKeys,
+ password,
+ primaryIdentityPublicKeys,
+ username,
+ ],
);
const onSubmit = React.useCallback(
@@ -176,6 +192,8 @@
disabled={
primaryIdentityPublicKeys === null ||
primaryIdentityPublicKeys === undefined ||
+ notificationIdentityPublicKeys === null ||
+ notificationIdentityPublicKeys === undefined ||
inputDisabled
}
onClick={onSubmit}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 5:33 AM (18 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2561389
Default Alt Text
D6881.diff (3 KB)

Event Timeline