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

PM-3451 - Update password reprompt logic checks to ensure we have an existing cipher in the add/edit flows to avoid showing the MP reprompt in new cipher scenarios (#6031)

This commit is contained in:
Jared Snider 2023-08-15 11:35:01 -04:00 committed by GitHub
parent 3a2d89c948
commit 993f37fbae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -604,7 +604,14 @@ export class VaultComponent implements OnInit, OnDestroy {
async editCipherId(id: string) {
const cipher = await this.cipherService.get(id);
if (cipher?.reprompt !== 0 && !(await this.passwordRepromptService.showPasswordPrompt())) {
// if cipher exists (cipher is null when new) and MP reprompt
// is on for this cipher, then show password reprompt
if (
cipher &&
cipher.reprompt !== 0 &&
!(await this.passwordRepromptService.showPasswordPrompt())
) {
// didn't pass password prompt, so don't open add / edit modal
this.go({ cipherId: null, itemId: null });
return;
}

View File

@ -600,7 +600,14 @@ export class VaultComponent implements OnInit, OnDestroy {
additionalComponentParameters?: (comp: AddEditComponent) => void
) {
const cipher = await this.cipherService.get(cipherId);
if (cipher?.reprompt !== 0 && !(await this.passwordRepromptService.showPasswordPrompt())) {
// if cipher exists (cipher is null when new) and MP reprompt
// is on for this cipher, then show password reprompt
if (
cipher &&
cipher.reprompt !== 0 &&
!(await this.passwordRepromptService.showPasswordPrompt())
) {
// didn't pass password prompt, so don't open add / edit modal
this.go({ cipherId: null, itemId: null });
return;
}