1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 01:33:33 +00:00

Update client for authService refactor (#2302)

This commit is contained in:
Thomas Rittson
2022-02-08 09:06:37 +10:00
committed by GitHub
parent a6272d4092
commit 7d43835ea2
5 changed files with 29 additions and 14 deletions

View File

@@ -32,6 +32,7 @@ import { SyncService } from "jslib-common/services/sync.service";
import { SystemService } from "jslib-common/services/system.service";
import { TokenService } from "jslib-common/services/token.service";
import { TotpService } from "jslib-common/services/totp.service";
import { TwoFactorService } from "jslib-common/services/twoFactor.service";
import { UserVerificationService } from "jslib-common/services/userVerification.service";
import { WebCryptoFunctionService } from "jslib-common/services/webCryptoFunction.service";
@@ -66,6 +67,7 @@ import { SyncService as SyncServiceAbstraction } from "jslib-common/abstractions
import { SystemService as SystemServiceAbstraction } from "jslib-common/abstractions/system.service";
import { TokenService as TokenServiceAbstraction } from "jslib-common/abstractions/token.service";
import { TotpService as TotpServiceAbstraction } from "jslib-common/abstractions/totp.service";
import { TwoFactorService as TwoFactorServiceAbstraction } from "jslib-common/abstractions/twoFactor.service";
import { UserVerificationService as UserVerificationServiceAbstraction } from "jslib-common/abstractions/userVerification.service";
import { VaultTimeoutService as VaultTimeoutServiceAbstraction } from "jslib-common/abstractions/vaultTimeout.service";
@@ -141,6 +143,7 @@ export default class MainBackground {
providerService: ProviderServiceAbstraction;
keyConnectorService: KeyConnectorServiceAbstraction;
userVerificationService: UserVerificationServiceAbstraction;
twoFactorService: TwoFactorServiceAbstraction;
onUpdatedRan: boolean;
onReplacedRan: boolean;
@@ -264,7 +267,8 @@ export default class MainBackground {
this.apiService,
this.tokenService,
this.logService,
this.organizationService
this.organizationService,
this.cryptoFunctionService
);
const vaultTimeoutServiceCallbacks = {
@@ -345,7 +349,8 @@ export default class MainBackground {
this.folderService,
this.cipherService,
this.apiService,
this.cryptoService
this.cryptoService,
this.cryptoFunctionService
);
this.notificationsService = new NotificationsService(
this.syncService,
@@ -451,6 +456,8 @@ export default class MainBackground {
);
this.windowsBackground = new WindowsBackground(this);
this.twoFactorService = new TwoFactorService(this.i18nService, this.platformUtilsService);
const that = this;
const backgroundMessagingService = new (class extends MessagingServiceAbstraction {
// AuthService should send the messages to the background not popup.
@@ -464,15 +471,13 @@ export default class MainBackground {
this.apiService,
this.tokenService,
this.appIdService,
this.i18nService,
this.platformUtilsService,
backgroundMessagingService,
this.vaultTimeoutService,
this.logService,
this.cryptoFunctionService,
this.keyConnectorService,
this.environmentService,
this.stateService
this.stateService,
this.twoFactorService
);
}
@@ -481,7 +486,6 @@ export default class MainBackground {
await this.stateService.init();
(this.authService as AuthService).init();
await (this.vaultTimeoutService as VaultTimeoutService).init(true);
await (this.i18nService as I18nService).init();
await (this.eventService as EventService).init(true);
@@ -489,6 +493,8 @@ export default class MainBackground {
await this.notificationBackground.init();
await this.commandsBackground.init();
this.twoFactorService.init();
await this.tabsBackground.init();
await this.contextMenusBackground.init();
await this.idleBackground.init();