diff --git a/apps/desktop/src/app/services/set-initial-password/desktop-set-initial-password.service.ts b/apps/desktop/src/app/services/set-initial-password/desktop-set-initial-password.service.ts index 1406e822860..691a83489a6 100644 --- a/apps/desktop/src/app/services/set-initial-password/desktop-set-initial-password.service.ts +++ b/apps/desktop/src/app/services/set-initial-password/desktop-set-initial-password.service.ts @@ -1,7 +1,7 @@ import { OrganizationUserApiService } from "@bitwarden/admin-console/common"; import { DefaultSetInitialPasswordService } from "@bitwarden/angular/auth/password-management/set-initial-password/default-set-initial-password.service.implementation"; import { - SetInitialPasswordCredentials, + SetInitialPasswordCredentialsOld, SetInitialPasswordCredentialsV2, SetInitialPasswordService, SetInitialPasswordUserType, @@ -54,12 +54,12 @@ export class DesktopSetInitialPasswordService /** * @deprecated To be removed in PM-28143 */ - override async setInitialPassword( - credentials: SetInitialPasswordCredentials, + override async setInitialPasswordOld( + credentials: SetInitialPasswordCredentialsOld, userType: SetInitialPasswordUserType, userId: UserId, ) { - await super.setInitialPassword(credentials, userType, userId); + await super.setInitialPasswordOld(credentials, userType, userId); this.messagingService.send("redrawMenu"); } diff --git a/apps/web/src/app/auth/core/services/password-management/set-initial-password/web-set-initial-password.service.ts b/apps/web/src/app/auth/core/services/password-management/set-initial-password/web-set-initial-password.service.ts index 8a2290b140c..9f076cc062c 100644 --- a/apps/web/src/app/auth/core/services/password-management/set-initial-password/web-set-initial-password.service.ts +++ b/apps/web/src/app/auth/core/services/password-management/set-initial-password/web-set-initial-password.service.ts @@ -1,7 +1,7 @@ import { OrganizationUserApiService } from "@bitwarden/admin-console/common"; import { DefaultSetInitialPasswordService } from "@bitwarden/angular/auth/password-management/set-initial-password/default-set-initial-password.service.implementation"; import { - SetInitialPasswordCredentials, + SetInitialPasswordCredentialsOld, SetInitialPasswordCredentialsV2, SetInitialPasswordService, SetInitialPasswordUserType, @@ -56,12 +56,12 @@ export class WebSetInitialPasswordService /** * @deprecated To be removed in PM-28143 */ - override async setInitialPassword( - credentials: SetInitialPasswordCredentials, + override async setInitialPasswordOld( + credentials: SetInitialPasswordCredentialsOld, userType: SetInitialPasswordUserType, userId: UserId, ) { - await super.setInitialPassword(credentials, userType, userId); + await super.setInitialPasswordOld(credentials, userType, userId); /** * TODO: Investigate refactoring the following logic in https://bitwarden.atlassian.net/browse/PM-22615 diff --git a/libs/angular/src/auth/password-management/set-initial-password/default-set-initial-password.service.implementation.ts b/libs/angular/src/auth/password-management/set-initial-password/default-set-initial-password.service.implementation.ts index a04d5f811af..afb15a17005 100644 --- a/libs/angular/src/auth/password-management/set-initial-password/default-set-initial-password.service.implementation.ts +++ b/libs/angular/src/auth/password-management/set-initial-password/default-set-initial-password.service.implementation.ts @@ -36,7 +36,7 @@ import { PureCrypto } from "@bitwarden/sdk-internal"; import { SetInitialPasswordService, - SetInitialPasswordCredentials, + SetInitialPasswordCredentialsOld, SetInitialPasswordUserType, SetInitialPasswordTdeOffboardingCredentials, SetInitialPasswordCredentialsV2, @@ -60,8 +60,8 @@ export class DefaultSetInitialPasswordService implements SetInitialPasswordServi /** * @deprecated To be removed in PM-28143 */ - async setInitialPassword( - credentials: SetInitialPasswordCredentials, + async setInitialPasswordOld( + credentials: SetInitialPasswordCredentialsOld, userType: SetInitialPasswordUserType, userId: UserId, ): Promise { @@ -162,7 +162,7 @@ export class DefaultSetInitialPasswordService implements SetInitialPasswordServi await this.masterPasswordService.setForceSetPasswordReason(ForceSetPasswordReason.None, userId); // User now has a password so update account decryption options in state - await this.updateAccountDecryptionProperties( + await this.updateAccountDecryptionPropertiesOld( newMasterKey, kdfConfig, masterKeyEncryptedUserKey, @@ -366,7 +366,7 @@ export class DefaultSetInitialPasswordService implements SetInitialPasswordServi /** * @deprecated To be removed in PM-28143 */ - private async updateAccountDecryptionProperties( + private async updateAccountDecryptionPropertiesOld( masterKey: MasterKey, kdfConfig: KdfConfig, masterKeyEncryptedUserKey: [UserKey, EncString], diff --git a/libs/angular/src/auth/password-management/set-initial-password/set-initial-password.component.ts b/libs/angular/src/auth/password-management/set-initial-password/set-initial-password.component.ts index 75eb8e8ce01..6b280ab78fb 100644 --- a/libs/angular/src/auth/password-management/set-initial-password/set-initial-password.component.ts +++ b/libs/angular/src/auth/password-management/set-initial-password/set-initial-password.component.ts @@ -23,7 +23,6 @@ import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/ import { ForceSetPasswordReason } from "@bitwarden/common/auth/models/domain/force-set-password-reason"; import { assertTruthy, assertNonNullish } from "@bitwarden/common/auth/utils"; import { InternalMasterPasswordServiceAbstraction } from "@bitwarden/common/key-management/master-password/abstractions/master-password.service.abstraction"; -import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; @@ -40,7 +39,7 @@ import { import { I18nPipe } from "@bitwarden/ui-common"; import { - SetInitialPasswordCredentials, + SetInitialPasswordCredentialsOld, SetInitialPasswordCredentialsV2, SetInitialPasswordService, SetInitialPasswordTdeOffboardingCredentials, @@ -73,7 +72,6 @@ export class SetInitialPasswordComponent implements OnInit { private accountService: AccountService, private activatedRoute: ActivatedRoute, private anonLayoutWrapperDataService: AnonLayoutWrapperDataService, - private configService: ConfigService, private dialogService: DialogService, private i18nService: I18nService, private logoutService: LogoutService, @@ -204,7 +202,7 @@ export class SetInitialPasswordComponent implements OnInit { return; } - await this.setInitialPassword(passwordInputResult); + await this.setInitialPasswordOld(passwordInputResult); break; } @@ -222,7 +220,7 @@ export class SetInitialPasswordComponent implements OnInit { /** * @deprecated To be removed in PM-28143 */ - private async setInitialPassword(passwordInputResult: PasswordInputResult) { + private async setInitialPasswordOld(passwordInputResult: PasswordInputResult) { const ctx = "Could not set initial password."; assertTruthy(passwordInputResult.newMasterKey, "newMasterKey", ctx); assertTruthy(passwordInputResult.newServerMasterKeyHash, "newServerMasterKeyHash", ctx); @@ -238,7 +236,7 @@ export class SetInitialPasswordComponent implements OnInit { assertNonNullish(this.resetPasswordAutoEnroll, "resetPasswordAutoEnroll", ctx); // can have `false` as a valid value, so check non-nullish try { - const credentials: SetInitialPasswordCredentials = { + const credentials: SetInitialPasswordCredentialsOld = { newMasterKey: passwordInputResult.newMasterKey, newServerMasterKeyHash: passwordInputResult.newServerMasterKeyHash, newLocalMasterKeyHash: passwordInputResult.newLocalMasterKeyHash, @@ -251,7 +249,7 @@ export class SetInitialPasswordComponent implements OnInit { salt: passwordInputResult.salt, }; - await this.setInitialPasswordService.setInitialPassword( + await this.setInitialPasswordService.setInitialPasswordOld( credentials, this.userType, this.userId, diff --git a/libs/angular/src/auth/password-management/set-initial-password/set-initial-password.service.abstraction.ts b/libs/angular/src/auth/password-management/set-initial-password/set-initial-password.service.abstraction.ts index 95765b5cb0f..0d43d79d46e 100644 --- a/libs/angular/src/auth/password-management/set-initial-password/set-initial-password.service.abstraction.ts +++ b/libs/angular/src/auth/password-management/set-initial-password/set-initial-password.service.abstraction.ts @@ -45,7 +45,7 @@ export const SetInitialPasswordUserType: Readonly<{ /** * @deprecated To be removed in PM-28143 */ -export interface SetInitialPasswordCredentials { +export interface SetInitialPasswordCredentialsOld { newMasterKey: MasterKey; newServerMasterKeyHash: string; newLocalMasterKeyHash: string; @@ -90,8 +90,8 @@ export abstract class SetInitialPasswordService { * @throws If any property on the `credentials` object is null or undefined, or if a * masterKeyEncryptedUserKey or newKeyPair could not be created. */ - abstract setInitialPassword: ( - credentials: SetInitialPasswordCredentials, + abstract setInitialPasswordOld: ( + credentials: SetInitialPasswordCredentialsOld, userType: SetInitialPasswordUserType, userId: UserId, ) => Promise; diff --git a/libs/auth/src/angular/input-password/password-input-result.ts b/libs/auth/src/angular/input-password/password-input-result.ts index a13c754b93c..bba56cc278e 100644 --- a/libs/auth/src/angular/input-password/password-input-result.ts +++ b/libs/auth/src/angular/input-password/password-input-result.ts @@ -16,7 +16,7 @@ export interface PasswordInputResult { * * To be removed in PM-28143 */ - newApisFlagEnabled: boolean; + newApisFlagEnabled?: boolean; // The deprecated properties below will be removed in PM-28143: https://bitwarden.atlassian.net/browse/PM-28143