old attachments check when rotating enc key
This commit is contained in:
parent
1b9943a4c8
commit
6d8b156455
|
@ -29,7 +29,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="checkbox" id="rotateEncKey" name="RotateEncKey" [(ngModel)]="rotateEncKey"
|
<input class="form-check-input" type="checkbox" id="rotateEncKey" name="RotateEncKey" [(ngModel)]="rotateEncKey"
|
||||||
(change)="showEncKeyWarning()">
|
(change)="rotateEncKeyClicked()">
|
||||||
<label class="form-check-label" for="rotateEncKey">
|
<label class="form-check-label" for="rotateEncKey">
|
||||||
{{'rotateAccountEncKey' | i18n}}
|
{{'rotateAccountEncKey' | i18n}}
|
||||||
</label>
|
</label>
|
||||||
|
|
|
@ -128,8 +128,30 @@ export class ChangePasswordComponent implements OnInit {
|
||||||
}, 300);
|
}, 300);
|
||||||
}
|
}
|
||||||
|
|
||||||
async showEncKeyWarning() {
|
async rotateEncKeyClicked() {
|
||||||
if (this.rotateEncKey) {
|
if (this.rotateEncKey) {
|
||||||
|
const ciphers = await this.cipherService.getAllDecrypted();
|
||||||
|
let hasOldAttachments = false;
|
||||||
|
if (ciphers != null) {
|
||||||
|
for (let i = 0; i < ciphers.length; i++) {
|
||||||
|
if (ciphers[i].organizationId == null && ciphers[i].hasOldAttachments) {
|
||||||
|
hasOldAttachments = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasOldAttachments) {
|
||||||
|
const learnMore = await this.platformUtilsService.showDialog(
|
||||||
|
this.i18nService.t('oldAttachmentsNeedFixDesc'), null,
|
||||||
|
this.i18nService.t('learnMore'), this.i18nService.t('close'), 'warning');
|
||||||
|
if (learnMore) {
|
||||||
|
this.platformUtilsService.launchUri('https://help.bitwarden.com/article/attachments/');
|
||||||
|
}
|
||||||
|
this.rotateEncKey = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const result = await this.platformUtilsService.showDialog(
|
const result = await this.platformUtilsService.showDialog(
|
||||||
this.i18nService.t('updateEncryptionKeyWarning') + ' ' +
|
this.i18nService.t('updateEncryptionKeyWarning') + ' ' +
|
||||||
this.i18nService.t('rotateEncKeyConfirmation'), this.i18nService.t('rotateEncKeyTitle'),
|
this.i18nService.t('rotateEncKeyConfirmation'), this.i18nService.t('rotateEncKeyTitle'),
|
||||||
|
|
|
@ -2541,12 +2541,15 @@
|
||||||
"message": "Are you sure you want to rotate your account's encryption key?"
|
"message": "Are you sure you want to rotate your account's encryption key?"
|
||||||
},
|
},
|
||||||
"attachmentsNeedFix": {
|
"attachmentsNeedFix": {
|
||||||
"message": "This item has old attachments that need to be fixed."
|
"message": "This item has old file attachments that need to be fixed."
|
||||||
},
|
},
|
||||||
"attachmentFixDesc": {
|
"attachmentFixDesc": {
|
||||||
"message": "This is an old attachment the needs to be fixed. Click to learn more."
|
"message": "This is an old file attachment the needs to be fixed. Click to learn more."
|
||||||
},
|
},
|
||||||
"fix": {
|
"fix": {
|
||||||
"message": "Fix"
|
"message": "Fix"
|
||||||
|
},
|
||||||
|
"oldAttachmentsNeedFixDesc": {
|
||||||
|
"message": "There are old file attachments in your vault that need to be fixed before you can rotate your account's encryption key."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue