1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-05 18:47:52 +01:00

Password reprompt fixes (#393)

* Hide card secrets, and ensure password is reprompted when navigating away

* Check password reprompt before downloading attachments
This commit is contained in:
Oscar Hinton 2021-05-28 19:38:04 +02:00 committed by GitHub
parent dddcc2bc93
commit 25a91313ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -436,7 +436,7 @@ export class AddEditComponent implements OnInit {
async toggleCardNumber() { async toggleCardNumber() {
this.showCardNumber = !this.showCardNumber; this.showCardNumber = !this.showCardNumber;
if (this.showCardNumber) { if (this.showCardNumber) {
this.eventService.collect(EventType.Cipher_ClientToggledCardCodeVisible, this.cipherId); this.eventService.collect(EventType.Cipher_ClientToggledCardNumberVisible, this.cipherId);
} }
} }

View File

@ -286,6 +286,9 @@ export class ViewComponent implements OnDestroy, OnInit {
} }
async downloadAttachment(attachment: AttachmentView) { async downloadAttachment(attachment: AttachmentView) {
if (!await this.promptPassword()) {
return;
}
const a = (attachment as any); const a = (attachment as any);
if (a.downloading) { if (a.downloading) {
return; return;
@ -353,6 +356,9 @@ export class ViewComponent implements OnDestroy, OnInit {
this.totpCode = null; this.totpCode = null;
this.cipher = null; this.cipher = null;
this.showPassword = false; this.showPassword = false;
this.showCardNumber = false;
this.showCardCode = false;
this.passwordReprompted = false;
if (this.totpInterval) { if (this.totpInterval) {
clearInterval(this.totpInterval); clearInterval(this.totpInterval);
} }