scout_capS
tRPC3y 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!
Was this page helpful?