mirror of
https://github.com/bitwarden/browser
synced 2026-02-05 19:23:19 +00:00
[PM-27086] rename new methods
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
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,
|
||||
} from "@bitwarden/angular/auth/password-management/set-initial-password/set-initial-password.service.abstraction";
|
||||
@@ -64,12 +64,12 @@ export class DesktopSetInitialPasswordService
|
||||
this.messagingService.send("redrawMenu");
|
||||
}
|
||||
|
||||
override async setInitialPasswordV2(
|
||||
credentials: SetInitialPasswordCredentialsV2,
|
||||
override async setInitialPassword(
|
||||
credentials: SetInitialPasswordCredentials,
|
||||
userType: SetInitialPasswordUserType,
|
||||
userId: UserId,
|
||||
) {
|
||||
await super.setInitialPasswordV2(credentials, userType, userId);
|
||||
await super.setInitialPassword(credentials, userType, userId);
|
||||
|
||||
this.messagingService.send("redrawMenu");
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
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,
|
||||
} from "@bitwarden/angular/auth/password-management/set-initial-password/set-initial-password.service.abstraction";
|
||||
@@ -88,12 +88,12 @@ export class WebSetInitialPasswordService
|
||||
await this.organizationInviteService.clearOrganizationInvitation();
|
||||
}
|
||||
|
||||
override async setInitialPasswordV2(
|
||||
credentials: SetInitialPasswordCredentialsV2,
|
||||
override async setInitialPassword(
|
||||
credentials: SetInitialPasswordCredentials,
|
||||
userType: SetInitialPasswordUserType,
|
||||
userId: UserId,
|
||||
) {
|
||||
await super.setInitialPasswordV2(credentials, userType, userId);
|
||||
await super.setInitialPassword(credentials, userType, userId);
|
||||
|
||||
/**
|
||||
* TODO: Investigate refactoring the following logic in https://bitwarden.atlassian.net/browse/PM-22615
|
||||
|
||||
@@ -39,7 +39,7 @@ import {
|
||||
SetInitialPasswordCredentialsOld,
|
||||
SetInitialPasswordUserType,
|
||||
SetInitialPasswordTdeOffboardingCredentials,
|
||||
SetInitialPasswordCredentialsV2,
|
||||
SetInitialPasswordCredentials,
|
||||
} from "./set-initial-password.service.abstraction";
|
||||
|
||||
export class DefaultSetInitialPasswordService implements SetInitialPasswordService {
|
||||
@@ -210,8 +210,8 @@ export class DefaultSetInitialPasswordService implements SetInitialPasswordServi
|
||||
}
|
||||
}
|
||||
|
||||
async setInitialPasswordV2(
|
||||
credentials: SetInitialPasswordCredentialsV2,
|
||||
async setInitialPassword(
|
||||
credentials: SetInitialPasswordCredentials,
|
||||
userType: SetInitialPasswordUserType,
|
||||
userId: UserId,
|
||||
): Promise<void> {
|
||||
@@ -318,7 +318,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.updateAccountDecryptionPropertiesV2(unlockData, userKey, userId);
|
||||
await this.updateAccountDecryptionProperties(unlockData, userKey, userId);
|
||||
|
||||
/**
|
||||
* Set the private key only for new JIT provisioned users in MP encryption orgs.
|
||||
@@ -391,7 +391,7 @@ export class DefaultSetInitialPasswordService implements SetInitialPasswordServi
|
||||
await this.keyService.setUserKey(masterKeyEncryptedUserKey[0], userId);
|
||||
}
|
||||
|
||||
private async updateAccountDecryptionPropertiesV2(
|
||||
private async updateAccountDecryptionProperties(
|
||||
unlockData: MasterPasswordUnlockData,
|
||||
userKey: UserKey,
|
||||
userId: UserId,
|
||||
|
||||
@@ -39,8 +39,8 @@ import {
|
||||
import { I18nPipe } from "@bitwarden/ui-common";
|
||||
|
||||
import {
|
||||
SetInitialPasswordCredentials,
|
||||
SetInitialPasswordCredentialsOld,
|
||||
SetInitialPasswordCredentialsV2,
|
||||
SetInitialPasswordService,
|
||||
SetInitialPasswordTdeOffboardingCredentials,
|
||||
SetInitialPasswordUserType,
|
||||
@@ -198,7 +198,7 @@ export class SetInitialPasswordComponent implements OnInit {
|
||||
case SetInitialPasswordUserType.TDE_ORG_USER_RESET_PASSWORD_PERMISSION_REQUIRES_MP: {
|
||||
// Remove wrapping "if" check in PM-28143
|
||||
if (passwordInputResult.newApisFlagEnabled) {
|
||||
await this.setInitialPasswordV2(passwordInputResult);
|
||||
await this.setInitialPassword(passwordInputResult);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ export class SetInitialPasswordComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
private async setInitialPasswordV2(passwordInputResult: PasswordInputResult) {
|
||||
private async setInitialPassword(passwordInputResult: PasswordInputResult) {
|
||||
const ctx = "Could not set initial password.";
|
||||
|
||||
assertTruthy(passwordInputResult.newPassword, "newPassword", ctx);
|
||||
@@ -280,7 +280,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: SetInitialPasswordCredentialsV2 = {
|
||||
const credentials: SetInitialPasswordCredentials = {
|
||||
newPassword: passwordInputResult.newPassword,
|
||||
newPasswordHint: passwordInputResult.newPasswordHint,
|
||||
kdfConfig: passwordInputResult.kdfConfig,
|
||||
@@ -290,7 +290,7 @@ export class SetInitialPasswordComponent implements OnInit {
|
||||
resetPasswordAutoEnroll: this.resetPasswordAutoEnroll,
|
||||
};
|
||||
|
||||
await this.setInitialPasswordService.setInitialPasswordV2(
|
||||
await this.setInitialPasswordService.setInitialPassword(
|
||||
credentials,
|
||||
this.userType,
|
||||
this.userId,
|
||||
|
||||
@@ -56,7 +56,7 @@ export interface SetInitialPasswordCredentialsOld {
|
||||
resetPasswordAutoEnroll: boolean;
|
||||
}
|
||||
|
||||
export interface SetInitialPasswordCredentialsV2 {
|
||||
export interface SetInitialPasswordCredentials {
|
||||
newPassword: string;
|
||||
newPasswordHint: string;
|
||||
kdfConfig: KdfConfig;
|
||||
@@ -118,8 +118,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 setInitialPasswordV2: (
|
||||
credentials: SetInitialPasswordCredentialsV2,
|
||||
abstract setInitialPassword: (
|
||||
credentials: SetInitialPasswordCredentials,
|
||||
userType: SetInitialPasswordUserType,
|
||||
userId: UserId,
|
||||
) => Promise<void>;
|
||||
|
||||
Reference in New Issue
Block a user