From 2f7f36ac85e6d503ca4b0016d5d5cb526e3efcaa Mon Sep 17 00:00:00 2001 From: Faye Duxovni Date: Fri, 3 Jun 2022 08:57:52 -0400 Subject: [PATCH] Ensure the first device on a newly-registered account gets cross-signed properly (#8750) --- cypress/integration/1-register/register.spec.ts | 5 +++++ .../views/dialogs/security/CreateSecretStorageDialog.tsx | 4 ++-- .../views/dialogs/security/CreateCrossSigningDialog.tsx | 6 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cypress/integration/1-register/register.spec.ts b/cypress/integration/1-register/register.spec.ts index 3dba78c490..3d710cd965 100644 --- a/cypress/integration/1-register/register.spec.ts +++ b/cypress/integration/1-register/register.spec.ts @@ -67,5 +67,10 @@ describe("Registration", () => { cy.url().should('contain', '/#/home'); cy.stopMeasuring("from-submit-to-home"); + + cy.get('[aria-label="User menu"]').click(); + cy.get('[aria-label="Security & Privacy"]').click(); + cy.get(".mx_DevicesPanel_myDevice .mx_DevicesPanel_deviceTrust .mx_E2EIcon") + .should("have.class", "mx_E2EIcon_verified"); }); }); diff --git a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx index f58a8b2003..f310157d28 100644 --- a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx +++ b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx @@ -274,9 +274,9 @@ export default class CreateSecretStorageDialog extends React.PureComponent void): Promise => { + private doBootstrapUIAuth = async (makeRequest: (authData: any) => Promise): Promise => { if (this.state.canUploadKeysWithPasswordOnly && this.state.accountPassword) { - makeRequest({ + await makeRequest({ type: 'm.login.password', identifier: { type: 'm.id.user', diff --git a/src/components/views/dialogs/security/CreateCrossSigningDialog.tsx b/src/components/views/dialogs/security/CreateCrossSigningDialog.tsx index 4b1928c3a7..9cab9a909f 100644 --- a/src/components/views/dialogs/security/CreateCrossSigningDialog.tsx +++ b/src/components/views/dialogs/security/CreateCrossSigningDialog.tsx @@ -91,9 +91,9 @@ export default class CreateCrossSigningDialog extends React.PureComponent void): Promise => { + private doBootstrapUIAuth = async (makeRequest: (authData: any) => Promise): Promise => { if (this.state.canUploadKeysWithPasswordOnly && this.state.accountPassword) { - makeRequest({ + await makeRequest({ type: 'm.login.password', identifier: { type: 'm.id.user', @@ -106,7 +106,7 @@ export default class CreateCrossSigningDialog extends React.PureComponent