1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-23 16:13:21 +00:00

[PM-27086] minor refactoring & comment update

This commit is contained in:
rr-bw
2025-12-30 17:29:49 -08:00
parent 55b0f0c773
commit 881a5156bc
3 changed files with 4 additions and 3 deletions

View File

@@ -237,7 +237,7 @@ export class DefaultSetInitialPasswordService implements SetInitialPasswordServi
throw new Error("userType not found. Could not set password.");
}
let userKey = await firstValueFrom(this.keyService.userKey$(userId));
let userKey: UserKey = await firstValueFrom(this.keyService.userKey$(userId));
if (userKey == null) {
userKey = new SymmetricCryptoKey(PureCrypto.make_user_key_aes256_cbc_hmac()) as UserKey;

View File

@@ -271,11 +271,12 @@ export class SetInitialPasswordComponent implements OnInit {
assertTruthy(passwordInputResult.newPassword, "newPassword", ctx);
assertTruthy(passwordInputResult.kdfConfig, "kdfConfig", ctx);
assertTruthy(passwordInputResult.salt, "salt", ctx);
assertNonNullish(passwordInputResult.newPasswordHint, "newPasswordHint", ctx); // can have an empty string as a valid value, so check non-nullish
assertTruthy(this.orgSsoIdentifier, "orgSsoIdentifier", ctx);
assertTruthy(this.orgId, "orgId", ctx);
assertTruthy(this.userType, "userType", ctx);
assertTruthy(this.userId, "userId", ctx);
assertNonNullish(passwordInputResult.newPasswordHint, "newPasswordHint", ctx); // can have an empty string as a valid value, so check non-nullish
assertNonNullish(this.resetPasswordAutoEnroll, "resetPasswordAutoEnroll", ctx); // can have `false` as a valid value, so check non-nullish
try {

View File

@@ -116,7 +116,7 @@ export abstract class SetInitialPasswordService {
*
* @param credentials An object of the credentials needed to set the initial password
* @throws If any property on the `credentials` object is null or undefined, or if a
* masterKeyEncryptedUserKey or newKeyPair could not be created.
* keyPair could not be found/created for a JIT_PROVISIONED_MP_ORG_USER
*/
abstract setInitialPassword: (
credentials: SetInitialPasswordCredentials,