Skip to content

Commit

Permalink
fix(core): update comments and rename method name
Browse files Browse the repository at this point in the history
update comment and rename method name
  • Loading branch information
simeng-li committed Jul 22, 2024
1 parent f8ef529 commit b99e3cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export class PasswordValidator {
}

Check warning on line 32 in packages/core/src/routes/experience/classes/validators/password-validator.ts

View check run for this annotation

Codecov / codecov/patch

packages/core/src/routes/experience/classes/validators/password-validator.ts#L28-L32

Added lines #L28 - L32 were not covered by tests

/**
* Validate password against the given password policy
* throw a {@link RequestError} 422 if the password is invalid; otherwise, do nothing.
* Validate password against the password policy
* @throws {RequestError} with status 422 if the password does not meet the policy
*/
public async validatePassword(password: string, profile: InteractionProfile) {
const userInfo = getUserInfo({
Expand All @@ -51,7 +51,7 @@ export class PasswordValidator {
}
}

Check warning on line 52 in packages/core/src/routes/experience/classes/validators/password-validator.ts

View check run for this annotation

Codecov / codecov/patch

packages/core/src/routes/experience/classes/validators/password-validator.ts#L39-L52

Added lines #L39 - L52 were not covered by tests

public async encryptPassword(password: string) {
public async createPasswordDigest(password: string) {
return encryptUserPassword(password);
}

Check warning on line 56 in packages/core/src/routes/experience/classes/validators/password-validator.ts

View check run for this annotation

Codecov / codecov/patch

packages/core/src/routes/experience/classes/validators/password-validator.ts#L55-L56

Added lines #L55 - L56 were not covered by tests
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ export class NewPasswordIdentityVerification
const passwordValidator = new PasswordValidator(passwordPolicy);
await passwordValidator.validatePassword(password, identifierProfile);

Check warning on line 105 in packages/core/src/routes/experience/classes/verifications/new-password-identity-verification.ts

View check run for this annotation

Codecov / codecov/patch

packages/core/src/routes/experience/classes/verifications/new-password-identity-verification.ts#L103-L105

Added lines #L103 - L105 were not covered by tests

const { passwordEncrypted, passwordEncryptionMethod } = await passwordValidator.encryptPassword(
password
);
const { passwordEncrypted, passwordEncryptionMethod } =
await passwordValidator.createPasswordDigest(password);

Check warning on line 108 in packages/core/src/routes/experience/classes/verifications/new-password-identity-verification.ts

View check run for this annotation

Codecov / codecov/patch

packages/core/src/routes/experience/classes/verifications/new-password-identity-verification.ts#L107-L108

Added lines #L107 - L108 were not covered by tests

this.passwordEncrypted = passwordEncrypted;
this.passwordEncryptionMethod = passwordEncryptionMethod;
Expand Down

0 comments on commit b99e3cf

Please sign in to comment.