Separate browser foreground and background memory space (#9315)

* Separate browser foreground and background memory space

* Prefer inherited DI providers
This commit is contained in:
Matt Gibson 2024-05-27 08:54:24 -04:00 committed by GitHub
parent 2e6280ce88
commit 93b9eba769
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 11 deletions

View File

@ -25,7 +25,7 @@ import { VaultTimeoutService } from "@bitwarden/common/abstractions/vault-timeou
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
import { AccountService as AccountServiceAbstraction } from "@bitwarden/common/auth/abstractions/account.service";
import { AuthService as AuthServiceAbstraction } from "@bitwarden/common/auth/abstractions/auth.service";
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
import { DeviceTrustServiceAbstraction } from "@bitwarden/common/auth/abstractions/device-trust.service.abstraction";
import { DevicesServiceAbstraction } from "@bitwarden/common/auth/abstractions/devices/devices.service.abstraction";
import { KdfConfigService } from "@bitwarden/common/auth/abstractions/kdf-config.service";
@ -34,7 +34,6 @@ import { InternalMasterPasswordServiceAbstraction } from "@bitwarden/common/auth
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";
import { TokenService } from "@bitwarden/common/auth/abstractions/token.service";
import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction";
import { AuthService } from "@bitwarden/common/auth/services/auth.service";
import {
AutofillSettingsService,
AutofillSettingsServiceAbstraction,
@ -174,12 +173,7 @@ const safeProviders: SafeProvider[] = [
safeProvider({
provide: BaseUnauthGuardService,
useClass: UnauthGuardService,
deps: [AuthServiceAbstraction, Router],
}),
safeProvider({
provide: AuthServiceAbstraction,
useFactory: getBgService<AuthService>("authService"),
deps: [],
deps: [AuthService, Router],
}),
safeProvider({
provide: SsoLoginServiceAbstraction,

View File

@ -11,8 +11,8 @@ import {
import { ApiService } from "../../abstractions/api.service";
import { CryptoService } from "../../platform/abstractions/crypto.service";
import { MessagingService } from "../../platform/abstractions/messaging.service";
import { StateService } from "../../platform/abstractions/state.service";
import { MessageSender } from "../../platform/messaging";
import { Utils } from "../../platform/misc/utils";
import { UserId } from "../../types/guid";
import { AccountService } from "../abstractions/account.service";
@ -26,7 +26,7 @@ export class AuthService implements AuthServiceAbstraction {
constructor(
protected accountService: AccountService,
protected messagingService: MessagingService,
protected messageSender: MessageSender,
protected cryptoService: CryptoService,
protected apiService: ApiService,
protected stateService: StateService,
@ -95,6 +95,6 @@ export class AuthService implements AuthServiceAbstraction {
logOut(callback: () => void) {
callback();
this.messagingService.send("loggedOut");
this.messageSender.send("loggedOut");
}
}