From 5bad4e229fe7cb3d4e99a14ab9f70ae05a7a4d5f Mon Sep 17 00:00:00 2001 From: simeng-li Date: Mon, 22 Jul 2024 13:44:41 +0800 Subject: [PATCH] fix(core): fix rebase issue fix rebase issue --- .../routes/experience/classes/experience-interaction.ts | 4 ++-- packages/core/src/routes/experience/classes/profile.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/core/src/routes/experience/classes/experience-interaction.ts b/packages/core/src/routes/experience/classes/experience-interaction.ts index 77eb2a1ef2aa..0a6b9a5b6ff1 100644 --- a/packages/core/src/routes/experience/classes/experience-interaction.ts +++ b/packages/core/src/routes/experience/classes/experience-interaction.ts @@ -229,13 +229,13 @@ export default class ExperienceInteraction { ); if (password) { - await this.#profile.encryptAndSetPassword(password); + await this.#profile.setPasswordDigest(password); } } public async resetPassword(password: string) { await this.getIdentifiedUser(); - await this.#profile.encryptAndSetPassword(password, true); + await this.#profile.setPasswordDigest(password, true); } /** diff --git a/packages/core/src/routes/experience/classes/profile.ts b/packages/core/src/routes/experience/classes/profile.ts index 308fd4b8070e..427b595fef65 100644 --- a/packages/core/src/routes/experience/classes/profile.ts +++ b/packages/core/src/routes/experience/classes/profile.ts @@ -50,18 +50,18 @@ export class Profile { * @throws {RequestError} 422 if the password does not meet the password policy. * @throws {RequestError} 422 if the password is the same as the current user's password. */ - async encryptAndSetPassword(password: string, reset = false) { + async setPasswordDigest(password: string, reset = false) { const user = await this.getUserFromContext(); const passwordPolicy = await this.signInExperienceValidator.getPasswordPolicy(); const passwordValidator = new PasswordValidator(passwordPolicy, user); await passwordValidator.validatePassword(password, this.#data); - const encryptedPasswordData = await passwordValidator.encryptPassword(password); + const passwordDigests = await passwordValidator.createPasswordDigest(password); if (!reset) { - this.profileValidator.guardProfileNotExistInCurrentUserAccount(user, encryptedPasswordData); + this.profileValidator.guardProfileNotExistInCurrentUserAccount(user, passwordDigests); } - this.unsafeSet(encryptedPasswordData); + this.unsafeSet(passwordDigests); } /**