switch to using an explicit verify button when cross-signing a new login
parent
1427aa4203
commit
7673818400
|
@ -19,6 +19,8 @@ import PropTypes from 'prop-types';
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import SdkConfig from '../../../SdkConfig';
|
import SdkConfig from '../../../SdkConfig';
|
||||||
import { MatrixClientPeg } from '../../../MatrixClientPeg';
|
import { MatrixClientPeg } from '../../../MatrixClientPeg';
|
||||||
|
import Modal from '../../../Modal';
|
||||||
|
import VerificationRequestDialog from '../../views/dialogs/VerificationRequestDialog';
|
||||||
import * as sdk from '../../../index';
|
import * as sdk from '../../../index';
|
||||||
import {
|
import {
|
||||||
SetupEncryptionStore,
|
SetupEncryptionStore,
|
||||||
|
@ -81,6 +83,22 @@ export default class SetupEncryptionBody extends React.Component {
|
||||||
store.usePassPhrase();
|
store.usePassPhrase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_onVerifyClick = () => {
|
||||||
|
const cli = MatrixClientPeg.get();
|
||||||
|
const userId = cli.getUserId();
|
||||||
|
const requestPromise = cli.requestVerification(userId);
|
||||||
|
|
||||||
|
this.props.onFinished(true);
|
||||||
|
Modal.createTrackedDialog('New Session Verification', 'Starting dialog', VerificationRequestDialog, {
|
||||||
|
verificationRequestPromise: requestPromise,
|
||||||
|
member: cli.getUser(userId),
|
||||||
|
onFinished: async () => {
|
||||||
|
const request = await requestPromise;
|
||||||
|
request.cancel();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onSkipClick = () => {
|
onSkipClick = () => {
|
||||||
const store = SetupEncryptionStore.sharedInstance();
|
const store = SetupEncryptionStore.sharedInstance();
|
||||||
store.skip();
|
store.skip();
|
||||||
|
@ -132,32 +150,24 @@ export default class SetupEncryptionBody extends React.Component {
|
||||||
</AccessibleButton>;
|
</AccessibleButton>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let verifyButton;
|
||||||
|
if (store.hasDevicesToVerifyAgainst) {
|
||||||
|
verifyButton = <AccessibleButton kind="primary" onClick={this._onVerifyClick}>
|
||||||
|
{ _t("Verify against another session") }
|
||||||
|
</AccessibleButton>;
|
||||||
|
}
|
||||||
|
|
||||||
const brand = SdkConfig.get().brand;
|
const brand = SdkConfig.get().brand;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<p>{_t(
|
<p>{_t(
|
||||||
"Confirm your identity by verifying this login from one of your other sessions, " +
|
"Verify this login to access your encrypted messages and " +
|
||||||
"granting it access to encrypted messages.",
|
"prove to others that this login is really you."
|
||||||
)}</p>
|
)}</p>
|
||||||
<p>{_t(
|
|
||||||
"This requires the latest %(brand)s on your other devices:",
|
|
||||||
{ brand },
|
|
||||||
)}</p>
|
|
||||||
|
|
||||||
<div className="mx_CompleteSecurity_clients">
|
|
||||||
<div className="mx_CompleteSecurity_clients_desktop">
|
|
||||||
<div>{_t("%(brand)s Web", { brand })}</div>
|
|
||||||
<div>{_t("%(brand)s Desktop", { brand })}</div>
|
|
||||||
</div>
|
|
||||||
<div className="mx_CompleteSecurity_clients_mobile">
|
|
||||||
<div>{_t("%(brand)s iOS", { brand })}</div>
|
|
||||||
<div>{_t("%(brand)s Android", { brand })}</div>
|
|
||||||
</div>
|
|
||||||
<p>{_t("or another cross-signing capable Matrix client")}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="mx_CompleteSecurity_actionRow">
|
<div className="mx_CompleteSecurity_actionRow">
|
||||||
|
{verifyButton}
|
||||||
{useRecoveryKeyButton}
|
{useRecoveryKeyButton}
|
||||||
<AccessibleButton kind="danger" onClick={this.onSkipClick}>
|
<AccessibleButton kind="danger" onClick={this.onSkipClick}>
|
||||||
{_t("Skip")}
|
{_t("Skip")}
|
||||||
|
|
Loading…
Reference in New Issue