#Microservices & shared Guards ?

4 messages · Page 1 of 1 (latest)

steady sinew
#

Hello,

I recently started to rework my monolithic application into a microservices architecture.

I'm currently stuck on my Guards migration.
My API has different endpoints that use some Guards like @UseGuards(JwtAuthGuard) or @UseGuards(HttpBearerGuard).

However, I haven't found a way to create some "shared" Guards & Strategies in order to avoid duplicate code between my microservices.

Does anyone have an idea in order to achieve that?
Or maybe I have to duplicate my Guards for every microservice that needs him?

Internet hasn't succeeded in clearly bringing me an answer :/

Regards

worldly forum
#

Share it as a package on your private registry

steady sinew
#

the pros do that? 😎

worldly forum
#

If you say so 😂