1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-06-20 09:35:22 +02:00

PM-2286 Master Password Reprompt on Attachments Option (#5844)

* if master password reprompt is enabled the passwordRepromptModal will appear on attachments option in both individual and organization
This commit is contained in:
Jason Ng 2023-08-09 16:18:58 -04:00 committed by GitHub
parent 96c6b870cb
commit 3eab038a87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 10 deletions

View File

@ -498,6 +498,11 @@ export class VaultComponent implements OnInit, OnDestroy {
}
async editCipherAttachments(cipher: CipherView) {
if (cipher?.reprompt !== 0 && !(await this.passwordRepromptService.showPasswordPrompt())) {
this.go({ cipherId: null, itemId: null });
return;
}
const canAccessPremium = await this.stateService.getCanAccessPremium();
if (cipher.organizationId == null && !canAccessPremium) {
this.messagingService.send("premiumRequired");
@ -539,6 +544,10 @@ export class VaultComponent implements OnInit, OnDestroy {
}
async shareCipher(cipher: CipherView) {
if (cipher?.reprompt !== 0 && !(await this.passwordRepromptService.showPasswordPrompt())) {
this.go({ cipherId: null, itemId: null });
return;
}
const [modal] = await this.modalService.openViewRef(
ShareComponent,
this.shareModalRef,
@ -595,11 +604,9 @@ export class VaultComponent implements OnInit, OnDestroy {
async editCipherId(id: string) {
const cipher = await this.cipherService.get(id);
if (cipher != null && cipher.reprompt != 0) {
if (!(await this.passwordRepromptService.showPasswordPrompt())) {
this.go({ cipherId: null, itemId: null });
return;
}
if (cipher?.reprompt !== 0 && !(await this.passwordRepromptService.showPasswordPrompt())) {
this.go({ cipherId: null, itemId: null });
return;
}
const [modal, childComponent] = await this.modalService.openViewRef(

View File

@ -517,6 +517,11 @@ export class VaultComponent implements OnInit, OnDestroy {
}
async editCipherAttachments(cipher: CipherView) {
if (cipher?.reprompt !== 0 && !(await this.passwordRepromptService.showPasswordPrompt())) {
this.go({ cipherId: null, itemId: null });
return;
}
if (this.organization.maxStorageGb == null || this.organization.maxStorageGb === 0) {
this.messagingService.send("upgradeOrganization", { organizationId: cipher.organizationId });
return;
@ -595,11 +600,9 @@ export class VaultComponent implements OnInit, OnDestroy {
additionalComponentParameters?: (comp: AddEditComponent) => void
) {
const cipher = await this.cipherService.get(cipherId);
if (cipher != null && cipher.reprompt != 0) {
if (!(await this.passwordRepromptService.showPasswordPrompt())) {
this.go({ cipherId: null, itemId: null });
return;
}
if (cipher?.reprompt !== 0 && !(await this.passwordRepromptService.showPasswordPrompt())) {
this.go({ cipherId: null, itemId: null });
return;
}
const defaultComponentParameters = (comp: AddEditComponent) => {