1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-27 17:18:04 +01:00

[EC-189] Resolve password reprompt not appearing on linkable cipher (#1643)

This commit is contained in:
Oscar Hinton 2022-05-06 11:29:45 +02:00 committed by GitHub
parent 1c31d090a3
commit bc054236ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 6 deletions

View File

@ -16,6 +16,7 @@ import { CipherService } from "jslib-common/abstractions/cipher.service";
import { I18nService } from "jslib-common/abstractions/i18n.service";
import { MessagingService } from "jslib-common/abstractions/messaging.service";
import { OrganizationService } from "jslib-common/abstractions/organization.service";
import { PasswordRepromptService } from "jslib-common/abstractions/passwordReprompt.service";
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
import { SyncService } from "jslib-common/abstractions/sync.service";
import { CipherType } from "jslib-common/enums/cipherType";
@ -66,7 +67,8 @@ export class VaultComponent implements OnInit, OnDestroy {
private broadcasterService: BroadcasterService,
private ngZone: NgZone,
private platformUtilsService: PlatformUtilsService,
private cipherService: CipherService
private cipherService: CipherService,
private passwordRepromptService: PasswordRepromptService
) {}
ngOnInit() {
@ -281,6 +283,14 @@ export class VaultComponent implements OnInit, OnDestroy {
}
async editCipherId(cipherId: string) {
const cipher = await this.cipherService.get(cipherId);
if (cipher.reprompt != 0) {
if (!(await this.passwordRepromptService.showPasswordPrompt())) {
this.go({ cipherId: null });
return;
}
}
const [modal, childComponent] = await this.modalService.openViewRef(
AddEditComponent,
this.cipherAddEditModalRef,
@ -303,8 +313,7 @@ export class VaultComponent implements OnInit, OnDestroy {
);
modal.onClosedPromise().then(() => {
this.route.params;
this.router.navigate([], { queryParams: { cipherId: null }, queryParamsHandling: "merge" });
this.go({ cipherId: null });
});
return childComponent;

View File

@ -17,6 +17,7 @@ import { CryptoService } from "jslib-common/abstractions/crypto.service";
import { I18nService } from "jslib-common/abstractions/i18n.service";
import { MessagingService } from "jslib-common/abstractions/messaging.service";
import { OrganizationService } from "jslib-common/abstractions/organization.service";
import { PasswordRepromptService } from "jslib-common/abstractions/passwordReprompt.service";
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
import { ProviderService } from "jslib-common/abstractions/provider.service";
import { StateService } from "jslib-common/abstractions/state.service";
@ -87,7 +88,8 @@ export class VaultComponent implements OnInit, OnDestroy {
private stateService: StateService,
private organizationService: OrganizationService,
private providerService: ProviderService,
private cipherService: CipherService
private cipherService: CipherService,
private passwordRepromptService: PasswordRepromptService
) {}
async ngOnInit() {
@ -358,6 +360,14 @@ export class VaultComponent implements OnInit, OnDestroy {
}
async editCipherId(id: string) {
const cipher = await this.cipherService.get(id);
if (cipher.reprompt != 0) {
if (!(await this.passwordRepromptService.showPasswordPrompt())) {
this.go({ cipherId: null });
return;
}
}
const [modal, childComponent] = await this.modalService.openViewRef(
AddEditComponent,
this.cipherAddEditModalRef,
@ -379,8 +389,7 @@ export class VaultComponent implements OnInit, OnDestroy {
);
modal.onClosedPromise().then(() => {
this.route.params;
this.router.navigate([], { queryParams: { cipherId: null }, queryParamsHandling: "merge" });
this.go({ cipherId: null });
});
return childComponent;