mirror of
https://github.com/bitwarden/browser
synced 2026-01-03 09:03:32 +00:00
[AC-1012] Hide link to 2FA policy for Teams orgs (#6154)
- Also cleanup eslint warnings
This commit is contained in:
@@ -6,8 +6,10 @@ import { ModalService } from "@bitwarden/angular/services/modal.service";
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
|
||||
import { PolicyType } from "@bitwarden/common/admin-console/enums";
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { TwoFactorProviderType } from "@bitwarden/common/auth/enums/two-factor-provider-type";
|
||||
import { TwoFactorProviders } from "@bitwarden/common/auth/services/two-factor.service";
|
||||
import { ProductType } from "@bitwarden/common/enums";
|
||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||
|
||||
@@ -36,6 +38,7 @@ export class TwoFactorSetupComponent implements OnInit, OnDestroy {
|
||||
webAuthnModalRef: ViewContainerRef;
|
||||
|
||||
organizationId: string;
|
||||
organization: Organization;
|
||||
providers: any[] = [];
|
||||
canAccessPremium: boolean;
|
||||
showPolicyWarning = false;
|
||||
@@ -45,7 +48,7 @@ export class TwoFactorSetupComponent implements OnInit, OnDestroy {
|
||||
|
||||
tabbedHeader = true;
|
||||
|
||||
private destroy$ = new Subject<void>();
|
||||
protected destroy$ = new Subject<void>();
|
||||
private twoFactorAuthPolicyAppliesToActiveUser: boolean;
|
||||
|
||||
constructor(
|
||||
@@ -202,11 +205,15 @@ export class TwoFactorSetupComponent implements OnInit, OnDestroy {
|
||||
this.evaluatePolicies();
|
||||
}
|
||||
|
||||
private async evaluatePolicies() {
|
||||
private evaluatePolicies() {
|
||||
if (this.organizationId == null && this.providers.filter((p) => p.enabled).length === 1) {
|
||||
this.showPolicyWarning = this.twoFactorAuthPolicyAppliesToActiveUser;
|
||||
} else {
|
||||
this.showPolicyWarning = false;
|
||||
}
|
||||
}
|
||||
|
||||
get isEnterpriseOrg() {
|
||||
return this.organization?.planProductType === ProductType.Enterprise;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user