mirror of https://github.com/vector-im/riot-web
Merge pull request #4556 from matrix-org/travis/fix-reset
Ensure key backup gets dealt with correctly during secret storage resetpull/21833/head
commit
58a5b7f154
|
@ -236,12 +236,20 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (force) {
|
if (force) {
|
||||||
|
console.log("Forcing secret storage reset"); // log something so we can debug this later
|
||||||
await cli.bootstrapSecretStorage({
|
await cli.bootstrapSecretStorage({
|
||||||
authUploadDeviceSigningKeys: this._doBootstrapUIAuth,
|
authUploadDeviceSigningKeys: this._doBootstrapUIAuth,
|
||||||
createSecretStorageKey: async () => this._recoveryKey,
|
createSecretStorageKey: async () => this._recoveryKey,
|
||||||
setupNewKeyBackup: true,
|
setupNewKeyBackup: this.state.useKeyBackup,
|
||||||
setupNewSecretStorage: true,
|
setupNewSecretStorage: true,
|
||||||
});
|
});
|
||||||
|
if (!this.state.useKeyBackup && this.state.backupInfo) {
|
||||||
|
// If the user is resetting their cross-signing keys and doesn't want
|
||||||
|
// key backup (but had it enabled before), delete the key backup as it's
|
||||||
|
// no longer valid.
|
||||||
|
console.log("Deleting invalid key backup (secrets have been reset; key backup not requested)");
|
||||||
|
await cli.deleteKeyBackupVersion(this.state.backupInfo.version);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
await cli.bootstrapSecretStorage({
|
await cli.bootstrapSecretStorage({
|
||||||
authUploadDeviceSigningKeys: this._doBootstrapUIAuth,
|
authUploadDeviceSigningKeys: this._doBootstrapUIAuth,
|
||||||
|
|
|
@ -131,8 +131,8 @@ export default class CrossSigningPanel extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
_destroySecureSecretStorage = () => {
|
_destroySecureSecretStorage = () => {
|
||||||
const ConfirmDestoryCrossSigningDialog = sdk.getComponent("dialogs.ConfirmDestroyCrossSigningDialog");
|
const ConfirmDestroyCrossSigningDialog = sdk.getComponent("dialogs.ConfirmDestroyCrossSigningDialog");
|
||||||
Modal.createDialog(ConfirmDestoryCrossSigningDialog, {
|
Modal.createDialog(ConfirmDestroyCrossSigningDialog, {
|
||||||
onFinished: this.onDestroyStorage,
|
onFinished: this.onDestroyStorage,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue