diff --git a/apps/browser/src/autofill/background/auto-submit-login.background.spec.ts b/apps/browser/src/autofill/background/auto-submit-login.background.spec.ts index 9f197b02193a..373354b4c540 100644 --- a/apps/browser/src/autofill/background/auto-submit-login.background.spec.ts +++ b/apps/browser/src/autofill/background/auto-submit-login.background.spec.ts @@ -5,7 +5,6 @@ import { PolicyService } from "@bitwarden/common/admin-console/abstractions/poli import { Policy } from "@bitwarden/common/admin-console/models/domain/policy"; import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service"; import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status"; -import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; @@ -35,7 +34,6 @@ describe("AutoSubmitLoginBackground", () => { let scriptInjectorService: MockProxy; let authStatus$: BehaviorSubject; let authService: MockProxy; - let configService: MockProxy; let platformUtilsService: MockProxy; let policyDetails: MockProxy; let automaticAppLogInPolicy$: BehaviorSubject; @@ -56,9 +54,6 @@ describe("AutoSubmitLoginBackground", () => { authStatus$ = new BehaviorSubject(AuthenticationStatus.Unlocked); authService = mock(); authService.activeAccountStatus$ = authStatus$; - configService = mock({ - getFeatureFlag: jest.fn().mockResolvedValue(true), - }); platformUtilsService = mock(); policyDetails = mock({ enabled: true, @@ -78,7 +73,6 @@ describe("AutoSubmitLoginBackground", () => { autofillService, scriptInjectorService, authService, - configService, platformUtilsService, policyService, accountService, @@ -89,7 +83,7 @@ describe("AutoSubmitLoginBackground", () => { jest.clearAllMocks(); }); - describe("when the AutoSubmitLoginBackground feature is disabled", () => { + describe("when conditions prevent auto-submit policy activation", () => { it("destroys all event listeners when the AutomaticAppLogIn policy is not enabled", async () => { automaticAppLogInPolicy$.next([mock({ ...policyDetails, enabled: false })]); @@ -115,7 +109,7 @@ describe("AutoSubmitLoginBackground", () => { }); }); - describe("when the AutoSubmitLoginBackground feature is enabled", () => { + describe("when the AutomaticAppLogIn policy is valid and active", () => { let webRequestDetails: chrome.webRequest.WebRequestBodyDetails; describe("starting the auto-submit login workflow", () => { @@ -268,7 +262,6 @@ describe("AutoSubmitLoginBackground", () => { autofillService, scriptInjectorService, authService, - configService, platformUtilsService, policyService, accountService, diff --git a/apps/browser/src/autofill/background/auto-submit-login.background.ts b/apps/browser/src/autofill/background/auto-submit-login.background.ts index bce876e8f82b..dcafe21b63c9 100644 --- a/apps/browser/src/autofill/background/auto-submit-login.background.ts +++ b/apps/browser/src/autofill/background/auto-submit-login.background.ts @@ -10,8 +10,6 @@ import { AccountService } from "@bitwarden/common/auth/abstractions/account.serv import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service"; import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status"; import { getUserId } from "@bitwarden/common/auth/services/account.service"; -import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; -import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; @@ -42,7 +40,6 @@ export class AutoSubmitLoginBackground implements AutoSubmitLoginBackgroundAbstr private autofillService: AutofillService, private scriptInjectorService: ScriptInjectorService, private authService: AuthService, - private configService: ConfigService, private platformUtilsService: PlatformUtilsService, private policyService: PolicyService, private accountService: AccountService, @@ -51,25 +48,19 @@ export class AutoSubmitLoginBackground implements AutoSubmitLoginBackgroundAbstr } /** - * Initializes the auto-submit login policy. Will return early if - * the feature flag is not set. If the policy is not enabled, it + * Initializes the auto-submit login policy. If the policy is not enabled, it * will trigger a removal of any established listeners. */ async init() { - const featureFlagEnabled = await this.configService.getFeatureFlag( - FeatureFlag.IdpAutoSubmitLogin, - ); - if (featureFlagEnabled) { - this.accountService.activeAccount$ - .pipe( - getUserId, - switchMap((userId) => - this.policyService.policiesByType$(PolicyType.AutomaticAppLogIn, userId), - ), - getFirstPolicy, - ) - .subscribe(this.handleAutoSubmitLoginPolicySubscription.bind(this)); - } + this.accountService.activeAccount$ + .pipe( + getUserId, + switchMap((userId) => + this.policyService.policiesByType$(PolicyType.AutomaticAppLogIn, userId), + ), + getFirstPolicy, + ) + .subscribe(this.handleAutoSubmitLoginPolicySubscription.bind(this)); } /** diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index a724f857cd12..e1537119134f 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -1239,7 +1239,6 @@ export default class MainBackground { this.autofillService, this.scriptInjectorService, this.authService, - this.configService, this.platformUtilsService, this.policyService, this.accountService, diff --git a/bitwarden_license/bit-web/src/app/app.component.ts b/bitwarden_license/bit-web/src/app/app.component.ts index 2d0dfd967a1b..ca6a5ea8f624 100644 --- a/bitwarden_license/bit-web/src/app/app.component.ts +++ b/bitwarden_license/bit-web/src/app/app.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit } from "@angular/core"; -import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; import { AppComponent as BaseAppComponent } from "@bitwarden/web-vault/app/app.component"; import { ActivateAutofillPolicy } from "./admin-console/policies/activate-autofill.component"; @@ -25,13 +24,8 @@ export class AppComponent extends BaseAppComponent implements OnInit { new ActivateAutofillPolicy(), ]); - this.configService.getFeatureFlag(FeatureFlag.IdpAutoSubmitLogin).then((enabled) => { - if ( - enabled && - !this.policyListService.getPolicies().some((p) => p instanceof AutomaticAppLoginPolicy) - ) { - this.policyListService.addPolicies([new AutomaticAppLoginPolicy()]); - } - }); + if (!this.policyListService.getPolicies().some((p) => p instanceof AutomaticAppLoginPolicy)) { + this.policyListService.addPolicies([new AutomaticAppLoginPolicy()]); + } } } diff --git a/libs/common/src/enums/feature-flag.enum.ts b/libs/common/src/enums/feature-flag.enum.ts index f9e68efe4bee..9e2c979ddd92 100644 --- a/libs/common/src/enums/feature-flag.enum.ts +++ b/libs/common/src/enums/feature-flag.enum.ts @@ -25,7 +25,6 @@ export enum FeatureFlag { DelayFido2PageScriptInitWithinMv2 = "delay-fido2-page-script-init-within-mv2", EnableNewCardCombinedExpiryAutofill = "enable-new-card-combined-expiry-autofill", GenerateIdentityFillScriptRefactor = "generate-identity-fill-script-refactor", - IdpAutoSubmitLogin = "idp-auto-submit-login", NotificationRefresh = "notification-refresh", UseTreeWalkerApiForPageDetailsCollection = "use-tree-walker-api-for-page-details-collection", MacOsNativeCredentialSync = "macos-native-credential-sync", @@ -92,7 +91,6 @@ export const DefaultFeatureFlagValue = { [FeatureFlag.DelayFido2PageScriptInitWithinMv2]: FALSE, [FeatureFlag.EnableNewCardCombinedExpiryAutofill]: FALSE, [FeatureFlag.GenerateIdentityFillScriptRefactor]: FALSE, - [FeatureFlag.IdpAutoSubmitLogin]: FALSE, [FeatureFlag.NotificationRefresh]: FALSE, [FeatureFlag.UseTreeWalkerApiForPageDetailsCollection]: FALSE, [FeatureFlag.MacOsNativeCredentialSync]: FALSE,