tRPCttRPC
Powered by
scout_capS
tRPC•3y ago•
4 replies
scout_cap

Middleware-ish for client

Hi! I had a quick question about client-side usage:

I have users with long-running sessions, and if they tokens expire the backend returns a 401. In the old codebase I'm migrating from there was a check force a token refresh if certain parameters were met, such as status === 401, route is one of x, etc. Is there a way to handle that on the @trpc/client ? something just like: for any requests, if returned status is 401, and route is one of x, force a token refresh? Thanks!
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’s for routers
KrishnaKKrishna / ❓-help
8mo ago
Can I respond to client from a middleware?
venegoVvenego / ❓-help
16mo ago
is there a way to do client-side "middleware"?
TomTTom / ❓-help
3y ago