I've been searching on tutorial or document to follow how to implement right authentication in nestjs graphql federation I found two option :
- Create auth module in user microservice and in every microservice i duplicate the code
- Create auth in shared module and call it in other microservices
For the first option i think in duplicating code is not the best practice, for the second option i think that i need to expose user microservice data to other microservice that leads me to the first option which is duplicating the code
Questions
- What is the best practice i need to use ?
- how to let other microservices works with auth module like guards token data etc ...
I tried a lot of example but no result since i don't understand the phenomen correctly