diff --git a/libs/auth/src/common/services/auth-request/two-factor-auth-component-cache.service.spec.ts b/libs/auth/src/angular/two-factor-auth/two-factor-auth-component-cache.service.spec.ts similarity index 88% rename from libs/auth/src/common/services/auth-request/two-factor-auth-component-cache.service.spec.ts rename to libs/auth/src/angular/two-factor-auth/two-factor-auth-component-cache.service.spec.ts index cf8a70a4f3f..0993954fde1 100644 --- a/libs/auth/src/common/services/auth-request/two-factor-auth-component-cache.service.spec.ts +++ b/libs/auth/src/angular/two-factor-auth/two-factor-auth-component-cache.service.spec.ts @@ -8,15 +8,15 @@ import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { - TwoFactorAuthCache, + TwoFactorAuthComponentCache, TwoFactorAuthComponentCacheService, - TwoFactorAuthData, -} from "./two-factor-auth-cache.service"; + TwoFactorAuthComponentData, +} from "./two-factor-auth-component-cache.service"; describe("TwoFactorAuthCache", () => { describe("fromJSON", () => { it("returns null when input is null", () => { - const result = TwoFactorAuthCache.fromJSON(null as any); + const result = TwoFactorAuthComponentCache.fromJSON(null as any); expect(result).toBeNull(); }); @@ -26,10 +26,10 @@ describe("TwoFactorAuthCache", () => { remember: true, selectedProviderType: TwoFactorProviderType.Email, }; - const result = TwoFactorAuthCache.fromJSON(jsonData as any); + const result = TwoFactorAuthComponentCache.fromJSON(jsonData as any); expect(result).not.toBeNull(); - expect(result).toBeInstanceOf(TwoFactorAuthCache); + expect(result).toBeInstanceOf(TwoFactorAuthComponentCache); expect(result?.token).toBe("123456"); expect(result?.remember).toBe(true); expect(result?.selectedProviderType).toBe(TwoFactorProviderType.Email); @@ -41,15 +41,15 @@ describe("TwoFactorAuthComponentCacheService", () => { let service: TwoFactorAuthComponentCacheService; let mockViewCacheService: MockProxy; let mockConfigService: MockProxy; - let cacheData: BehaviorSubject; + let cacheData: BehaviorSubject; let mockSignal: any; beforeEach(() => { mockViewCacheService = mock(); mockConfigService = mock(); - cacheData = new BehaviorSubject(null); + cacheData = new BehaviorSubject(null); mockSignal = jest.fn(() => cacheData.getValue()); - mockSignal.set = jest.fn((value: TwoFactorAuthCache | null) => cacheData.next(value)); + mockSignal.set = jest.fn((value: TwoFactorAuthComponentCache | null) => cacheData.next(value)); mockViewCacheService.signal.mockReturnValue(mockSignal); TestBed.configureTestingModule({ @@ -102,7 +102,7 @@ describe("TwoFactorAuthComponentCacheService", () => { }); it("caches complete data when feature is enabled", () => { - const testData: TwoFactorAuthData = { + const testData: TwoFactorAuthComponentData = { token: "123456", remember: true, selectedProviderType: TwoFactorProviderType.Email, @@ -166,7 +166,7 @@ describe("TwoFactorAuthComponentCacheService", () => { }); it("returns cached data when feature is enabled", () => { - const testData = new TwoFactorAuthCache(); + const testData = new TwoFactorAuthComponentCache(); testData.token = "123456"; testData.remember = true; testData.selectedProviderType = TwoFactorProviderType.Email; diff --git a/libs/auth/src/common/services/auth-request/two-factor-auth-component-cache.service.ts b/libs/auth/src/angular/two-factor-auth/two-factor-auth-component-cache.service.ts similarity index 100% rename from libs/auth/src/common/services/auth-request/two-factor-auth-component-cache.service.ts rename to libs/auth/src/angular/two-factor-auth/two-factor-auth-component-cache.service.ts diff --git a/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.ts b/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.ts index 032ec0b43a1..7f5f550859e 100644 --- a/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.ts +++ b/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.ts @@ -46,10 +46,6 @@ import { ToastService, } from "@bitwarden/components"; -import { - TwoFactorAuthComponentCacheService, - TwoFactorAuthComponentData, -} from "../../common/services/auth-request/two-factor-auth-component-cache.service"; import { AnonLayoutWrapperDataService } from "../anon-layout/anon-layout-wrapper-data.service"; import { TwoFactorAuthAuthenticatorIcon, @@ -64,6 +60,10 @@ import { TwoFactorAuthDuoComponent } from "./child-components/two-factor-auth-du import { TwoFactorAuthEmailComponent } from "./child-components/two-factor-auth-email/two-factor-auth-email.component"; import { TwoFactorAuthWebAuthnComponent } from "./child-components/two-factor-auth-webauthn/two-factor-auth-webauthn.component"; import { TwoFactorAuthYubikeyComponent } from "./child-components/two-factor-auth-yubikey.component"; +import { + TwoFactorAuthComponentCacheService, + TwoFactorAuthComponentData, +} from "./two-factor-auth-component-cache.service"; import { DuoLaunchAction, LegacyKeyMigrationAction,