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:
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user