@punks/backend-entity-manager 0.0.506 → 0.0.508

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -23813,7 +23813,7 @@ let UserCreationHandler = class UserCreationHandler {
23813
23813
  error: exports.UserCreationError.UserAlreadyExists,
23814
23814
  };
23815
23815
  }
23816
- if (user && !user.verified) {
23816
+ if (user && !user.verified && input.password) {
23817
23817
  const passwordHash = await this.createPasswordHash(input.password, user.id);
23818
23818
  await this.services.getUsersService().update(user.id, {
23819
23819
  passwordHash,
@@ -23827,10 +23827,11 @@ let UserCreationHandler = class UserCreationHandler {
23827
23827
  };
23828
23828
  }
23829
23829
  const newUser = await this.createUser(input.email, input.userName, input.registrationInfo, input.context);
23830
- const passwordHash = await this.createPasswordHash(input.password, newUser.id);
23831
23830
  await this.services.getUsersService().update(newUser.id, {
23832
- passwordHash,
23833
- passwordUpdateTimestamp: new Date(),
23831
+ ...(input.password && {
23832
+ passwordHash: await this.createPasswordHash(input.password, newUser.id),
23833
+ passwordUpdateTimestamp: new Date(),
23834
+ }),
23834
23835
  verified: input.verified ?? true,
23835
23836
  });
23836
23837
  this.logger.debug(`New user created: ${input.email} - ${input.userName}`, {