1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-09 05:00:10 +00:00

update injection of ChangePasswordService

This commit is contained in:
rr-bw
2025-03-29 20:49:09 -07:00
parent d2fd834a38
commit f46ea84177
5 changed files with 18 additions and 2 deletions

View File

@@ -0,0 +1 @@
export * from "./web-change-password.service";

View File

@@ -4,13 +4,13 @@ import { ChangePasswordService, DefaultChangePasswordService } from "@bitwarden/
import { Account } from "@bitwarden/common/auth/abstractions/account.service";
import { UserKeyRotationService } from "@bitwarden/web-vault/app/key-management/key-rotation/user-key-rotation.service";
export class WebChangePasswordComponent
export class WebChangePasswordService
extends DefaultChangePasswordService
implements ChangePasswordService
{
userKeyRotationService = inject(UserKeyRotationService);
async rotateUserKeyMasterPasswordAndEncryptedData(
override async rotateUserKeyMasterPasswordAndEncryptedData(
currentPassword: string,
newPassword: string,
user: Account,

View File

@@ -1,3 +1,4 @@
export * from "./change-password";
export * from "./login";
export * from "./login-decryption-options";
export * from "./webauthn-login";

View File

@@ -37,6 +37,7 @@ import {
TwoFactorAuthDuoComponentService,
} from "@bitwarden/auth/angular";
import {
ChangePasswordService,
InternalUserDecryptionOptionsServiceAbstraction,
LoginEmailService,
} from "@bitwarden/auth/common";
@@ -111,6 +112,7 @@ import { DefaultSshImportPromptService, SshImportPromptService } from "@bitwarde
import { flagEnabled } from "../../utils/flags";
import { PolicyListService } from "../admin-console/core/policy-list.service";
import {
WebChangePasswordService,
WebSetPasswordJitService,
WebRegistrationFinishService,
WebLoginComponentService,
@@ -380,6 +382,11 @@ const safeProviders: SafeProvider[] = [
useClass: DefaultSshImportPromptService,
deps: [DialogService, ToastService, PlatformUtilsService, I18nServiceAbstraction],
}),
safeProvider({
provide: ChangePasswordService,
useClass: WebChangePasswordService,
deps: [],
}),
];
@NgModule({

View File

@@ -46,6 +46,8 @@ import {
PinServiceAbstraction,
UserDecryptionOptionsService,
UserDecryptionOptionsServiceAbstraction,
ChangePasswordService,
DefaultChangePasswordService,
} from "@bitwarden/auth/common";
import { ApiService as ApiServiceAbstraction } from "@bitwarden/common/abstractions/api.service";
import { AuditService as AuditServiceAbstraction } from "@bitwarden/common/abstractions/audit.service";
@@ -1505,6 +1507,11 @@ const safeProviders: SafeProvider[] = [
useClass: MasterPasswordApiService,
deps: [ApiServiceAbstraction, LogService],
}),
safeProvider({
provide: ChangePasswordService,
useClass: DefaultChangePasswordService,
deps: [],
}),
];
@NgModule({