adrien2p / medusa-extender

:syringe: Medusa on steroid, take your medusa project to the next level with some badass features :rocket:
https://adrien2p.github.io/medusa-extender/
MIT License
320 stars 40 forks source link

[BUG] Middleware is not working #187

Closed nhatanhit closed 1 year ago

nhatanhit commented 1 year ago

Describe the bug My new middleware is not working for new module

To Reproduce Steps to reproduce the behavior:

  1. Follow this Getting Started with existing project: https://adrien2p.github.io/medusa-extender/#/?id=existing-medusa-project to setup medusa extender for my existing project
  2. Run command to generate the UserModule ./node_modules/.bin/medex g --module UserModule
  3. Run command to generate the UserMiddleware ./node_modules/.bin/medex g --module UserMiddleware
  4. Add a simple console.log statement to check if the middleware is running image
  5. Associate the middleware with new module has just been generated image
  6. Run following commands to build new module and new middleware npm run build npm run start
  7. After server finish the boostrap process, login into medusa admin website , and try calling some APIs for only authenticated user, but the text "Go to middleware" is not appeared on my console

Expected behavior The function in middleware should be triggered

Package version:

nhatanhit commented 1 year ago

My bad, forgot to import the module in main.ts I will mark done this issue