From 57911f210bcebb68557c31633ae8c9ff2c277731 Mon Sep 17 00:00:00 2001 From: Jordan Aasen <166539328+jaasen-livefront@users.noreply.github.com> Date: Thu, 22 May 2025 10:20:33 -0700 Subject: [PATCH] [PM-21896] - prevent double reprompt for copy password in desktop cipher form (#14883) * prevent double reprompt for copy password in desktop cipher form * adjust name * fix input name --- apps/desktop/src/vault/app/vault/vault.component.html | 1 + apps/desktop/src/vault/app/vault/view.component.ts | 4 ++++ libs/angular/src/vault/components/view.component.ts | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/vault/app/vault/vault.component.html b/apps/desktop/src/vault/app/vault/vault.component.html index 99131a848cc..9a25619b1a8 100644 --- a/apps/desktop/src/vault/app/vault/vault.component.html +++ b/apps/desktop/src/vault/app/vault/vault.component.html @@ -15,6 +15,7 @@ *ngIf="cipherId && action === 'view'" [cipherId]="cipherId" [collectionId]="activeFilter?.selectedCollectionId" + [masterPasswordAlreadyPrompted]="cipherRepromptId === cipherId" (onCloneCipher)="cloneCipherWithoutPasswordPrompt($event)" (onEditCipher)="editCipher($event)" (onViewCipherPasswordHistory)="viewCipherPasswordHistory($event)" diff --git a/apps/desktop/src/vault/app/vault/view.component.ts b/apps/desktop/src/vault/app/vault/view.component.ts index 084a9a747ed..68bf8d6d1a3 100644 --- a/apps/desktop/src/vault/app/vault/view.component.ts +++ b/apps/desktop/src/vault/app/vault/view.component.ts @@ -3,6 +3,7 @@ import { ChangeDetectorRef, Component, EventEmitter, + Input, NgZone, OnChanges, OnDestroy, @@ -46,6 +47,7 @@ const BroadcasterSubscriptionId = "ViewComponent"; }) export class ViewComponent extends BaseViewComponent implements OnInit, OnDestroy, OnChanges { @Output() onViewCipherPasswordHistory = new EventEmitter(); + @Input() masterPasswordAlreadyPrompted: boolean = false; constructor( cipherService: CipherService, @@ -120,6 +122,7 @@ export class ViewComponent extends BaseViewComponent implements OnInit, OnDestro } }); }); + this.passwordReprompted = this.masterPasswordAlreadyPrompted; } ngOnDestroy() { @@ -134,6 +137,7 @@ export class ViewComponent extends BaseViewComponent implements OnInit, OnDestro }); return; } + this.passwordReprompted = this.masterPasswordAlreadyPrompted; } viewHistory() { diff --git a/libs/angular/src/vault/components/view.component.ts b/libs/angular/src/vault/components/view.component.ts index 8915cb6b671..fd3f92c6c73 100644 --- a/libs/angular/src/vault/components/view.component.ts +++ b/libs/angular/src/vault/components/view.component.ts @@ -95,7 +95,7 @@ export class ViewComponent implements OnDestroy, OnInit { cipherType = CipherType; private previousCipherId: string; - private passwordReprompted = false; + protected passwordReprompted = false; /** * Represents TOTP information including display formatting and timing