You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
used the search to make sure that a similar issue hasn't already been submit
Expected Behavior
I am looking to get the user claims from my JWT so that I can get user id & name. I'd like to make this available everywhere as an injectable service, to avoid every controller route having to worry about passing the request down, and reduce the amount of parameters that need to go through every function.
Possible Solution
I've tried to create a UserService where I inject the request, but it doesn't work:
using a middleware to preload the service and pass the header to it, but there's no way (I can find) to inject that service into my middleware.
Make express.Request injectable, but again I'm not sure how I would go about this.
I really like tsoa and how it reduces the amount of (req, res) => {} functions in regular express servers, so I'm keen to avoid having to do this again with this library 😄
The text was updated successfully, but these errors were encountered:
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
I am looking to get the user claims from my JWT so that I can get user id & name. I'd like to make this available everywhere as an injectable service, to avoid every controller route having to worry about passing the request down, and reduce the amount of parameters that need to go through every function.
Possible Solution
I've tried to create a UserService where I inject the request, but it doesn't work:
A couple of other ideas:
I really like tsoa and how it reduces the amount of
(req, res) => {}
functions in regular express servers, so I'm keen to avoid having to do this again with this library 😄The text was updated successfully, but these errors were encountered: