mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 06:43:35 +00: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:
@@ -498,6 +498,11 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async editCipherAttachments(cipher: CipherView) {
|
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();
|
const canAccessPremium = await this.stateService.getCanAccessPremium();
|
||||||
if (cipher.organizationId == null && !canAccessPremium) {
|
if (cipher.organizationId == null && !canAccessPremium) {
|
||||||
this.messagingService.send("premiumRequired");
|
this.messagingService.send("premiumRequired");
|
||||||
@@ -539,6 +544,10 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async shareCipher(cipher: CipherView) {
|
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(
|
const [modal] = await this.modalService.openViewRef(
|
||||||
ShareComponent,
|
ShareComponent,
|
||||||
this.shareModalRef,
|
this.shareModalRef,
|
||||||
@@ -595,11 +604,9 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
async editCipherId(id: string) {
|
async editCipherId(id: string) {
|
||||||
const cipher = await this.cipherService.get(id);
|
const cipher = await this.cipherService.get(id);
|
||||||
if (cipher != null && cipher.reprompt != 0) {
|
if (cipher?.reprompt !== 0 && !(await this.passwordRepromptService.showPasswordPrompt())) {
|
||||||
if (!(await this.passwordRepromptService.showPasswordPrompt())) {
|
this.go({ cipherId: null, itemId: null });
|
||||||
this.go({ cipherId: null, itemId: null });
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [modal, childComponent] = await this.modalService.openViewRef(
|
const [modal, childComponent] = await this.modalService.openViewRef(
|
||||||
|
|||||||
@@ -517,6 +517,11 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async editCipherAttachments(cipher: CipherView) {
|
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) {
|
if (this.organization.maxStorageGb == null || this.organization.maxStorageGb === 0) {
|
||||||
this.messagingService.send("upgradeOrganization", { organizationId: cipher.organizationId });
|
this.messagingService.send("upgradeOrganization", { organizationId: cipher.organizationId });
|
||||||
return;
|
return;
|
||||||
@@ -595,11 +600,9 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
additionalComponentParameters?: (comp: AddEditComponent) => void
|
additionalComponentParameters?: (comp: AddEditComponent) => void
|
||||||
) {
|
) {
|
||||||
const cipher = await this.cipherService.get(cipherId);
|
const cipher = await this.cipherService.get(cipherId);
|
||||||
if (cipher != null && cipher.reprompt != 0) {
|
if (cipher?.reprompt !== 0 && !(await this.passwordRepromptService.showPasswordPrompt())) {
|
||||||
if (!(await this.passwordRepromptService.showPasswordPrompt())) {
|
this.go({ cipherId: null, itemId: null });
|
||||||
this.go({ cipherId: null, itemId: null });
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultComponentParameters = (comp: AddEditComponent) => {
|
const defaultComponentParameters = (comp: AddEditComponent) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user