From 9ed83b8648e9a33443d6f77a9b95fcce1cc1ee9c Mon Sep 17 00:00:00 2001 From: Zoe Date: Tue, 25 Feb 2020 11:34:01 +0000 Subject: [PATCH 1/2] Show a warning dialog when user indicates a new session wasn't them --- .../views/dialogs/NewSessionReviewDialog.js | 20 ++++++++++++++++++- .../views/toasts/UnverifiedSessionToast.js | 6 ++++++ src/i18n/strings/en_EN.json | 5 +++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/NewSessionReviewDialog.js b/src/components/views/dialogs/NewSessionReviewDialog.js index 0019e0644f..4cc8cb54ed 100644 --- a/src/components/views/dialogs/NewSessionReviewDialog.js +++ b/src/components/views/dialogs/NewSessionReviewDialog.js @@ -23,6 +23,7 @@ import VerificationRequestDialog from './VerificationRequestDialog'; import BaseDialog from './BaseDialog'; import DialogButtons from '../elements/DialogButtons'; import {MatrixClientPeg} from "../../../MatrixClientPeg"; +import * as sdk from '../../../index'; @replaceableComponent("views.dialogs.NewSessionReviewDialog") export default class NewSessionReviewDialog extends React.PureComponent { @@ -33,7 +34,24 @@ export default class NewSessionReviewDialog extends React.PureComponent { } onCancelClick = () => { - this.props.onFinished(false); + const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); + Modal.createTrackedDialog("Verification failed", "insecure", ErrorDialog, { + headerImage: require("../../../../res/img/e2e/warning.svg"), + title: _t("Your account is not secure"), + description:
+ {_t("One of the following may be compromised:")} + +
+ {_t("We recomment you change your password and recovery key in Settings immediately")} +
+
, + onFinished: () => this.props.onFinished(false), + }); } onContinueClick = async () => { diff --git a/src/components/views/toasts/UnverifiedSessionToast.js b/src/components/views/toasts/UnverifiedSessionToast.js index 15cf18f47d..cb0cadcdc8 100644 --- a/src/components/views/toasts/UnverifiedSessionToast.js +++ b/src/components/views/toasts/UnverifiedSessionToast.js @@ -42,6 +42,12 @@ export default class UnverifiedSessionToast extends React.PureComponent { Modal.createTrackedDialog('New Session Review', 'Starting dialog', NewSessionReviewDialog, { userId: MatrixClientPeg.get().getUserId(), device, + onFinished: (r) => { + if (!r) { + /* This'll come back false if the user clicks "this wasn't me" and saw a warning dialog */ + this._onLaterClick(); + } + }, }, null, /* priority = */ false, /* static = */ true); }; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 1d030f5118..31e9abd646 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1572,6 +1572,11 @@ "Are you sure you want to sign out?": "Are you sure you want to sign out?", "Your homeserver doesn't seem to support this feature.": "Your homeserver doesn't seem to support this feature.", "Message edits": "Message edits", + "Your account is not secure": "Your account is not secure", + "Your password": "Your password", + "This device, or the other device": "This device, or the other device", + "The internet connection either device is using": "The internet connection either device is using", + "We recomment you change your password and recovery key in Settings immediately": "We recomment you change your password and recovery key in Settings immediately", "New session": "New session", "Use this session to verify your new one, granting it access to encrypted messages:": "Use this session to verify your new one, granting it access to encrypted messages:", "If you didn’t sign in to this session, your account may be compromised.": "If you didn’t sign in to this session, your account may be compromised.", From 1d8756b95d7b7230159548911f781e94f55957cf Mon Sep 17 00:00:00 2001 From: Zoe Date: Tue, 25 Feb 2020 15:40:06 +0000 Subject: [PATCH 2/2] text improvements --- src/components/views/dialogs/NewSessionReviewDialog.js | 6 +++--- src/i18n/strings/en_EN.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/views/dialogs/NewSessionReviewDialog.js b/src/components/views/dialogs/NewSessionReviewDialog.js index 4cc8cb54ed..125811115f 100644 --- a/src/components/views/dialogs/NewSessionReviewDialog.js +++ b/src/components/views/dialogs/NewSessionReviewDialog.js @@ -43,11 +43,11 @@ export default class NewSessionReviewDialog extends React.PureComponent {
- {_t("We recomment you change your password and recovery key in Settings immediately")} + {_t("We recommend you change your password and recovery key in Settings immediately")}
, onFinished: () => this.props.onFinished(false), diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 31e9abd646..f702da6b4c 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1574,9 +1574,9 @@ "Message edits": "Message edits", "Your account is not secure": "Your account is not secure", "Your password": "Your password", - "This device, or the other device": "This device, or the other device", - "The internet connection either device is using": "The internet connection either device is using", - "We recomment you change your password and recovery key in Settings immediately": "We recomment you change your password and recovery key in Settings immediately", + "This session, or the other session": "This session, or the other session", + "The internet connection either session is using": "The internet connection either session is using", + "We recommend you change your password and recovery key in Settings immediately": "We recommend you change your password and recovery key in Settings immediately", "New session": "New session", "Use this session to verify your new one, granting it access to encrypted messages:": "Use this session to verify your new one, granting it access to encrypted messages:", "If you didn’t sign in to this session, your account may be compromised.": "If you didn’t sign in to this session, your account may be compromised.",