Skip to content

Commit 57911f2

Browse files
[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
1 parent 753e7af commit 57911f2

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

apps/desktop/src/vault/app/vault/vault.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*ngIf="cipherId && action === 'view'"
1616
[cipherId]="cipherId"
1717
[collectionId]="activeFilter?.selectedCollectionId"
18+
[masterPasswordAlreadyPrompted]="cipherRepromptId === cipherId"
1819
(onCloneCipher)="cloneCipherWithoutPasswordPrompt($event)"
1920
(onEditCipher)="editCipher($event)"
2021
(onViewCipherPasswordHistory)="viewCipherPasswordHistory($event)"

apps/desktop/src/vault/app/vault/view.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
ChangeDetectorRef,
44
Component,
55
EventEmitter,
6+
Input,
67
NgZone,
78
OnChanges,
89
OnDestroy,
@@ -46,6 +47,7 @@ const BroadcasterSubscriptionId = "ViewComponent";
4647
})
4748
export class ViewComponent extends BaseViewComponent implements OnInit, OnDestroy, OnChanges {
4849
@Output() onViewCipherPasswordHistory = new EventEmitter<CipherView>();
50+
@Input() masterPasswordAlreadyPrompted: boolean = false;
4951

5052
constructor(
5153
cipherService: CipherService,
@@ -120,6 +122,7 @@ export class ViewComponent extends BaseViewComponent implements OnInit, OnDestro
120122
}
121123
});
122124
});
125+
this.passwordReprompted = this.masterPasswordAlreadyPrompted;
123126
}
124127

125128
ngOnDestroy() {
@@ -134,6 +137,7 @@ export class ViewComponent extends BaseViewComponent implements OnInit, OnDestro
134137
});
135138
return;
136139
}
140+
this.passwordReprompted = this.masterPasswordAlreadyPrompted;
137141
}
138142

139143
viewHistory() {

libs/angular/src/vault/components/view.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class ViewComponent implements OnDestroy, OnInit {
9595
cipherType = CipherType;
9696

9797
private previousCipherId: string;
98-
private passwordReprompted = false;
98+
protected passwordReprompted = false;
9999

100100
/**
101101
* Represents TOTP information including display formatting and timing

0 commit comments

Comments
 (0)