@punks/backend-entity-manager 0.0.60 → 0.0.61

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
@@ -19086,11 +19086,13 @@ let UserRegistrationHandler = class UserRegistrationHandler {
19086
19086
  this.passwordHashingProvider = passwordHashingProvider;
19087
19087
  this.emailService = emailService;
19088
19088
  this.jwtProvider = jwtProvider;
19089
+ this.logger = backendCore.Log.getLogger("UserRegistration");
19089
19090
  }
19090
19091
  async execute(input) {
19091
19092
  const user = (await this.resolveUser(input.email, input.context)) ??
19092
19093
  (await this.resolveUser(input.userName, input.context));
19093
19094
  if (user && user.verified) {
19095
+ this.logger.debug(`User already exists: ${input.email} - ${input.userName}`, { user });
19094
19096
  return {
19095
19097
  success: false,
19096
19098
  error: exports.UserRegistrationError.UserAlreadyExists,
@@ -19103,6 +19105,7 @@ let UserRegistrationHandler = class UserRegistrationHandler {
19103
19105
  passwordUpdateTimestamp: new Date(),
19104
19106
  });
19105
19107
  await this.sendRegistrationEmail(user, input.callback, input.languageId);
19108
+ this.logger.debug(`User already exists but not verified. Sending new verification email: ${input.email} - ${input.userName}`, { user });
19106
19109
  return {
19107
19110
  success: true,
19108
19111
  };
@@ -19114,6 +19117,9 @@ let UserRegistrationHandler = class UserRegistrationHandler {
19114
19117
  passwordUpdateTimestamp: new Date(),
19115
19118
  });
19116
19119
  await this.sendRegistrationEmail(newUser, input.callback, input.languageId);
19120
+ this.logger.debug(`New user created: ${input.email} - ${input.userName}`, {
19121
+ user: newUser,
19122
+ });
19117
19123
  return {
19118
19124
  success: true,
19119
19125
  };
@@ -19554,9 +19560,6 @@ let NestEventEmitter = class NestEventEmitter {
19554
19560
  constructor(eventEmitter) {
19555
19561
  this.eventEmitter = eventEmitter;
19556
19562
  }
19557
- // setEmitter(eventEmitter: EventEmitter2) {
19558
- // this.eventEmitter = eventEmitter
19559
- // }
19560
19563
  async emit(event, ...args) {
19561
19564
  await this.eventEmitter.emitAsync(event, ...args);
19562
19565
  }
@@ -19704,7 +19707,6 @@ exports.EntityManagerInitializer = EntityManagerInitializer_1 = class EntityMana
19704
19707
  app
19705
19708
  .get(exports.ModulesContainerProvider)
19706
19709
  .setModulesContainer(staticProviders.modulesContainer);
19707
- // app.get(NestEventEmitter).setEmitter(staticProviders.eventEmitter)
19708
19710
  }
19709
19711
  async discoverRepositories() {
19710
19712
  return await this.discover.providersWithMetaAtKey(EntityManagerSymbols.EntityRepository);