1
0
mirror of https://github.com/bitwarden/browser synced 2026-03-02 03:21:19 +00:00

Remove Injectable decorator from class, use safeProvider.

This commit is contained in:
Miles Blackwood
2025-06-12 13:41:07 -04:00
parent 3e88388827
commit f6b49b0404
4 changed files with 31 additions and 32 deletions

View File

@@ -43,7 +43,7 @@ import { LoginView } from "@bitwarden/common/vault/models/view/login.view";
import { TaskService } from "@bitwarden/common/vault/tasks";
import { SecurityTaskType } from "@bitwarden/common/vault/tasks/enums";
import { SecurityTask } from "@bitwarden/common/vault/tasks/models/security-task";
import { DefaultChangeLoginPasswordService } from "@bitwarden/vault";
import { ChangeLoginPasswordService } from "@bitwarden/vault";
import { openUnlockPopout } from "../../auth/popup/utils/auth-popout-window";
import { BrowserApi } from "../../platform/browser/browser-api";
@@ -140,6 +140,7 @@ export default class NotificationBackground {
private themeStateService: ThemeStateService,
private userNotificationSettingsService: UserNotificationSettingsServiceAbstraction,
private taskService: TaskService,
private changeLoginPasswordService: ChangeLoginPasswordService,
protected messagingService: MessagingService,
) {}
@@ -401,10 +402,7 @@ export default class NotificationBackground {
): Promise<boolean> {
const { activeUserId, securityTask, cipher } = message.data;
const domain = Utils.getDomain(sender.tab.url);
const passwordChangeUri = await DefaultChangeLoginPasswordService.create(
{ nativeFetch: fetch },
{ getClientType: () => "browser" },
).getChangePasswordUrl(cipher);
const passwordChangeUri = await this.changeLoginPasswordService.getChangePasswordUrl(cipher);
const authStatus = await this.getAuthStatus();

View File

@@ -229,6 +229,7 @@ import {
KeyService as KeyServiceAbstraction,
} from "@bitwarden/key-management";
import { BackgroundSyncService } from "@bitwarden/platform/background-sync";
import { ChangeLoginPasswordService, DefaultChangeLoginPasswordService } from "@bitwarden/vault";
import {
IndividualVaultExportService,
IndividualVaultExportServiceAbstraction,
@@ -415,6 +416,8 @@ export default class MainBackground {
ipcContentScriptManagerService: IpcContentScriptManagerService;
ipcService: IpcService;
changeLoginPasswordService: ChangeLoginPasswordService;
onUpdatedRan: boolean;
onReplacedRan: boolean;
loginToAutoFill: CipherView = null;
@@ -1208,6 +1211,11 @@ export default class MainBackground {
messageListener,
);
this.changeLoginPasswordService = new DefaultChangeLoginPasswordService(
this.apiService,
this.platformUtilsService,
);
this.notificationBackground = new NotificationBackground(
this.accountService,
this.authService,
@@ -1224,6 +1232,7 @@ export default class MainBackground {
this.themeStateService,
this.userNotificationSettingsService,
this.taskService,
this.changeLoginPasswordService,
this.messagingService,
);