TanStackT
TanStack3y ago
10 replies
foolish-indigo

Authentication, Tanstack Query, React Router

As part of an application I'm building we're looking at using tanstack query in combination with a few other libraries to handle authentication and our API layer.

The problem is that if an authentication error is thrown in a query because a refresh token couldn't be refreshed or something similar, there's no way to catch that without making all queries throwOnError and handling the auth error from the router.

Any ideas or answers would be very much appreciated.
Was this page helpful?