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

remove comments

This commit is contained in:
rr-bw
2025-04-02 14:43:55 -07:00
parent a698f4a9b4
commit b262d11db1
6 changed files with 3 additions and 34 deletions

View File

@@ -24,7 +24,6 @@ export class PasswordSettingsComponent implements OnInit {
) {}
async ngOnInit() {
// TODO-rr-bw: test that no MP = get routed to settings/security/two-factor
const userHasMasterPassword = await firstValueFrom(
this.userDecryptionOptionsService.hasMasterPassword$,
);

View File

@@ -390,11 +390,9 @@ const safeProviders: SafeProvider[] = [
useClass: WebChangePasswordService,
deps: [
AccountService,
I18nServiceAbstraction,
KeyServiceAbstraction,
MasterPasswordApiServiceAbstraction,
InternalMasterPasswordServiceAbstraction,
ToastService,
],
}),
];

View File

@@ -1512,11 +1512,9 @@ const safeProviders: SafeProvider[] = [
useClass: DefaultChangePasswordService,
deps: [
AccountServiceAbstraction,
I18nServiceAbstraction,
KeyService,
MasterPasswordApiServiceAbstraction,
InternalMasterPasswordServiceAbstraction,
ToastService,
],
}),
];

View File

@@ -101,7 +101,7 @@ export class ChangePasswordComponent implements OnInit {
message: this.i18nService.t("masterPasswordChangedDesc"),
});
this.messagingService.send("logout"); // TODO-rr-bw: verify
this.messagingService.send("logout");
}
} catch (e) {
this.toastService.showToast({
@@ -128,16 +128,6 @@ export class ChangePasswordComponent implements OnInit {
throw new Error("Could not decrypt user key");
}
// TODO-rr-bw: do we still need this check/toast if it is handled in InputPasswordComponent?
if (decryptedUserKey == null) {
this.toastService.showToast({
variant: "error",
title: null,
message: this.i18nService.t("invalidMasterPassword"),
});
return;
}
const newMasterKeyEncryptedUserKey = await this.keyService.encryptUserKeyWithMasterKey(
passwordInputResult.newMasterKey,
decryptedUserKey,

View File

@@ -108,7 +108,7 @@ export class InputPasswordComponent implements OnInit {
protected secondaryButtonTextStr: string = "";
protected InputPasswordFlow = InputPasswordFlow;
private kdfConfig: KdfConfig = DEFAULT_KDF_CONFIG; // TODO-rr-bw: verify
private kdfConfig: KdfConfig = DEFAULT_KDF_CONFIG;
private minHintLength = 0;
protected maxHintLength = 50;
protected minPasswordLength = Utils.minimumPasswordLength;
@@ -222,7 +222,7 @@ export class InputPasswordComponent implements OnInit {
throw new Error("Email is required to create master key.");
}
this.kdfConfig = (await this.kdfConfigService.getKdfConfig()) || DEFAULT_KDF_CONFIG; // TODO-rr-bw: confirm this
this.kdfConfig = (await this.kdfConfigService.getKdfConfig()) || DEFAULT_KDF_CONFIG;
const currentPassword = this.formGroup.get("currentPassword")?.value;
const { newPassword, newPasswordHint, checkForBreaches } = this.formGroup.value;
@@ -445,7 +445,6 @@ export class InputPasswordComponent implements OnInit {
);
}
// TODO-rr-bw: verify
(this.formGroup.get("rotateUserKey") as unknown as FormControl<boolean>)?.setValue(false);
return;
}
@@ -462,7 +461,6 @@ export class InputPasswordComponent implements OnInit {
});
if (!result) {
// TODO-rr-bw: verify
(this.formGroup.get("rotateUserKey") as unknown as FormControl<boolean>)?.setValue(false);
}
}

View File

@@ -5,9 +5,7 @@ import { MasterPasswordApiService } from "@bitwarden/common/auth/abstractions/ma
import { PasswordRequest } from "@bitwarden/common/auth/models/request/password.request";
import { getUserId } from "@bitwarden/common/auth/services/account.service";
import { InternalMasterPasswordServiceAbstraction } from "@bitwarden/common/key-management/master-password/abstractions/master-password.service.abstraction";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { MasterKey } from "@bitwarden/common/types/key";
import { ToastService } from "@bitwarden/components";
import { KeyService } from "@bitwarden/key-management";
import { ChangePasswordService } from "../../abstractions";
@@ -15,11 +13,9 @@ import { ChangePasswordService } from "../../abstractions";
export class DefaultChangePasswordService implements ChangePasswordService {
constructor(
private accountService: AccountService,
private i18nService: I18nService,
private keyService: KeyService,
private masterPasswordApiService: MasterPasswordApiService,
private masterPasswordService: InternalMasterPasswordServiceAbstraction,
private toastService: ToastService,
) {}
async rotateUserKeyMasterPasswordAndEncryptedData(
@@ -56,16 +52,6 @@ export class DefaultChangePasswordService implements ChangePasswordService {
throw new Error("Could not decrypt user key");
}
// TODO-rr-bw: do we still need this check/toast if it is handled in InputPasswordComponent?
if (decryptedUserKey == null) {
this.toastService.showToast({
variant: "error",
title: null,
message: this.i18nService.t("invalidMasterPassword"),
});
return;
}
const newMasterKeyEncryptedUserKey = await this.keyService.encryptUserKeyWithMasterKey(
newMasterKey,
decryptedUserKey,