venego
venego2mo ago

Can I respond to client from a middleware?

I have this authentication middleware that needs to refresh the access token of a JWT session, and I don't want to duplicate the logic in all procedures. How can I send a response from the middleware itself? When I do a simple return, TS gives me some errors, it seems that it expects next() as an output.
0 Replies
No replies yetBe the first to reply to this messageJoin