From 2f1358cf0427a95d1a55a5027d8607f94fd0caf9 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Thu, 13 Jul 2023 09:34:43 +0200 Subject: [PATCH] [PM-2928] [PM-2929] [PM-2930] Fixes for: [PM-1203] Replace MP confirmation with verification code (#5798) * [PM-2928] feat: hide change email if user doen't have MP * [PM-2929] feat: hide KDF settings if user doesn't have MP * [PM-2930] feat: remove MP copy --- .../app/auth/settings/two-factor-verify.component.html | 1 - apps/web/src/app/settings/account.component.ts | 10 +++------- apps/web/src/app/settings/security-keys.component.ts | 6 +++--- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/apps/web/src/app/auth/settings/two-factor-verify.component.html b/apps/web/src/app/auth/settings/two-factor-verify.component.html index 523514f1ae..87d6b09984 100644 --- a/apps/web/src/app/auth/settings/two-factor-verify.component.html +++ b/apps/web/src/app/auth/settings/two-factor-verify.component.html @@ -1,6 +1,5 @@
diff --git a/apps/web/src/app/settings/account.component.ts b/apps/web/src/app/settings/account.component.ts index 4cedadc40e..45f5375654 100644 --- a/apps/web/src/app/settings/account.component.ts +++ b/apps/web/src/app/settings/account.component.ts @@ -1,9 +1,7 @@ import { Component, ViewChild, ViewContainerRef } from "@angular/core"; import { ModalService } from "@bitwarden/angular/services/modal.service"; -import { ApiService } from "@bitwarden/common/abstractions/api.service"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; -import { StateService } from "@bitwarden/common/platform/abstractions/state.service"; +import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction"; import { DeauthorizeSessionsComponent } from "../auth/settings/deauthorize-sessions.component"; @@ -26,13 +24,11 @@ export class AccountComponent { constructor( private modalService: ModalService, - private apiService: ApiService, - private keyConnectorService: KeyConnectorService, - private stateService: StateService + private userVerificationService: UserVerificationService ) {} async ngOnInit() { - this.showChangeEmail = !(await this.keyConnectorService.getUsesKeyConnector()); + this.showChangeEmail = await this.userVerificationService.hasMasterPassword(); } async deauthorizeSessions() { diff --git a/apps/web/src/app/settings/security-keys.component.ts b/apps/web/src/app/settings/security-keys.component.ts index 887ba3d587..2a01f6d010 100644 --- a/apps/web/src/app/settings/security-keys.component.ts +++ b/apps/web/src/app/settings/security-keys.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, ViewChild, ViewContainerRef } from "@angular/core"; import { ModalService } from "@bitwarden/angular/services/modal.service"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; -import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; +import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction"; import { StateService } from "@bitwarden/common/platform/abstractions/state.service"; import { ApiKeyComponent } from "./api-key.component"; @@ -20,14 +20,14 @@ export class SecurityKeysComponent implements OnInit { showChangeKdf = true; constructor( - private keyConnectorService: KeyConnectorService, + private userVerificationService: UserVerificationService, private stateService: StateService, private modalService: ModalService, private apiService: ApiService ) {} async ngOnInit() { - this.showChangeKdf = !(await this.keyConnectorService.getUsesKeyConnector()); + this.showChangeKdf = await this.userVerificationService.hasMasterPassword(); } async viewUserApiKey() {