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

Middleware (implements NestMiddleware) don't have lifecycle hooks? #3870

Closed
eonae opened this issue Jan 20, 2020 · 2 comments
Closed

Middleware (implements NestMiddleware) don't have lifecycle hooks? #3870

eonae opened this issue Jan 20, 2020 · 2 comments
Labels
needs triage This issue has not been looked into

Comments

@eonae
Copy link

eonae commented Jan 20, 2020

Hello, dear developers!

Dunno it's bug, of misunderstanding of documentation..

All kinds of nest classes: modules, services, guards etc. have onModuleBootstrap and other hooks.
And they work great!

But when it comes to middleware class which implements NestMiddleware - hooks are not triggered. That's because middleware is special? Or maybe some special condition should be met?

Middleware is pluged in as it's said in docs:

// inside module class
  configure(consumer: MiddlewareConsumer) {
    consumer
      .apply(AuthorizationMiddleware)
      .forRoutes({ path: '*', method: RequestMethod.ALL });
  }

App is starting successfully, middleware works fine. But hooks are not triggered. Is it the way it should be?

Thanks a lot!

@eonae eonae added the needs triage This issue has not been looked into label Jan 20, 2020
@kamilmysliwiec
Copy link
Member

Fixed in 6.11.0

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs triage This issue has not been looked into
Projects
None yet
Development

No branches or pull requests

2 participants