Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli createAdminUser register AdminUserService twice #208

Open
blue-hope opened this issue Jan 19, 2021 · 0 comments
Open

cli createAdminUser register AdminUserService twice #208

blue-hope opened this issue Jan 19, 2021 · 0 comments

Comments

@blue-hope
Copy link

when use cli - createAdminUser, AdminUserService is registered(or injected) twice.
In constructor of adminUserService,

constructor(connection, entityManager) {
      this.connection = connection;
      this.entityManager = entityManager;
      connection.subscribers.push(this);
      console.log('registered')
  }

I made logger like above, and it is printed twice

because the AdminUserService is registered twice, subscribers are registered twice and finally beforeInsert is called twice

I don't know why this happened. Because of the above issue, hashPassword is called twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant