warn users that changing/resetting password will nuke E2E keys
This commit is contained in:
parent
55591f2019
commit
5b61d00533
2 changed files with 55 additions and 22 deletions
|
@ -87,12 +87,28 @@ module.exports = React.createClass({
|
||||||
this.showErrorDialog("New passwords must match each other.");
|
this.showErrorDialog("New passwords must match each other.");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
||||||
|
Modal.createDialog(QuestionDialog, {
|
||||||
|
title: "Warning",
|
||||||
|
description:
|
||||||
|
<div>
|
||||||
|
Resetting password will currently reset any end-to-end encryption keys on all devices,
|
||||||
|
making encrypted chat history unreadable.
|
||||||
|
In future this <a href="https://github.com/vector-im/riot-web/issues/2671">may be improved</a>,
|
||||||
|
but for now be warned.
|
||||||
|
</div>,
|
||||||
|
button: "Continue",
|
||||||
|
onFinished: (confirmed) => {
|
||||||
|
if (confirmed) {
|
||||||
this.submitPasswordReset(
|
this.submitPasswordReset(
|
||||||
this.state.enteredHomeserverUrl, this.state.enteredIdentityServerUrl,
|
this.state.enteredHomeserverUrl, this.state.enteredIdentityServerUrl,
|
||||||
this.state.email, this.state.password
|
this.state.email, this.state.password
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onInputChanged: function(stateKey, ev) {
|
onInputChanged: function(stateKey, ev) {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
|
@ -18,6 +18,7 @@ limitations under the License.
|
||||||
|
|
||||||
var React = require('react');
|
var React = require('react');
|
||||||
var MatrixClientPeg = require("../../../MatrixClientPeg");
|
var MatrixClientPeg = require("../../../MatrixClientPeg");
|
||||||
|
var Modal = require("../../../Modal");
|
||||||
var sdk = require("../../../index");
|
var sdk = require("../../../index");
|
||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
|
@ -65,6 +66,19 @@ module.exports = React.createClass({
|
||||||
changePassword: function(old_password, new_password) {
|
changePassword: function(old_password, new_password) {
|
||||||
var cli = MatrixClientPeg.get();
|
var cli = MatrixClientPeg.get();
|
||||||
|
|
||||||
|
var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
||||||
|
Modal.createDialog(QuestionDialog, {
|
||||||
|
title: "Warning",
|
||||||
|
description:
|
||||||
|
<div>
|
||||||
|
Changing password will currently reset any end-to-end encryption keys on all devices,
|
||||||
|
making encrypted chat history unreadable.
|
||||||
|
This will be <a href="https://github.com/vector-im/riot-web/issues/2671">improved shortly</a>,
|
||||||
|
but for now be warned.
|
||||||
|
</div>,
|
||||||
|
button: "Continue",
|
||||||
|
onFinished: (confirmed) => {
|
||||||
|
if (confirmed) {
|
||||||
var authDict = {
|
var authDict = {
|
||||||
type: 'm.login.password',
|
type: 'm.login.password',
|
||||||
user: cli.credentials.userId,
|
user: cli.credentials.userId,
|
||||||
|
@ -85,6 +99,9 @@ module.exports = React.createClass({
|
||||||
phase: self.Phases.Edit
|
phase: self.Phases.Edit
|
||||||
});
|
});
|
||||||
}).done();
|
}).done();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onClickChange: function() {
|
onClickChange: function() {
|
||||||
|
|
Loading…
Reference in a new issue