tRPCttRPC
Powered by
venegoV
tRPC•16mo ago•
1 reply
venego

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()
next()
as an output.
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Middleware-ish for client
scout_capSscout_cap / ❓-help
3y ago
is there a way to do client-side "middleware"?
TomTTom / ❓-help
3y ago
can i send data from client to server in subscriptions
sevenSseven / ❓-help
11mo ago
Can middleware be used on a router?
aryzingAaryzing / ❓-help
3y ago