From 25a91313ad0441d1c02e043113f931f203fd57e6 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Fri, 28 May 2021 19:38:04 +0200 Subject: [PATCH] Password reprompt fixes (#393) * Hide card secrets, and ensure password is reprompted when navigating away * Check password reprompt before downloading attachments --- src/angular/components/add-edit.component.ts | 2 +- src/angular/components/view.component.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/angular/components/add-edit.component.ts b/src/angular/components/add-edit.component.ts index ed15a106d9..ab69fd243e 100644 --- a/src/angular/components/add-edit.component.ts +++ b/src/angular/components/add-edit.component.ts @@ -436,7 +436,7 @@ export class AddEditComponent implements OnInit { async toggleCardNumber() { this.showCardNumber = !this.showCardNumber; if (this.showCardNumber) { - this.eventService.collect(EventType.Cipher_ClientToggledCardCodeVisible, this.cipherId); + this.eventService.collect(EventType.Cipher_ClientToggledCardNumberVisible, this.cipherId); } } diff --git a/src/angular/components/view.component.ts b/src/angular/components/view.component.ts index 8791b87cca..f7d20ef99d 100644 --- a/src/angular/components/view.component.ts +++ b/src/angular/components/view.component.ts @@ -286,6 +286,9 @@ export class ViewComponent implements OnDestroy, OnInit { } async downloadAttachment(attachment: AttachmentView) { + if (!await this.promptPassword()) { + return; + } const a = (attachment as any); if (a.downloading) { return; @@ -353,6 +356,9 @@ export class ViewComponent implements OnDestroy, OnInit { this.totpCode = null; this.cipher = null; this.showPassword = false; + this.showCardNumber = false; + this.showCardCode = false; + this.passwordReprompted = false; if (this.totpInterval) { clearInterval(this.totpInterval); }