You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the default configuration of TanStack Query, state is injected into all requests, even if they came from a different user. This could leak information and should not the default.
Go to another page and reload: the server side context is injected back into page
Expected behavior
There should be no server side state injected into different requests. This could be a security issue if an authenticated client runs a query which is cached on the server, which then uses that cache to inject the state for a different user.
To get the expected behavior, I have made this my router.tsx:
// Create a new router instanceexportconstcreateRouter=()=>{constqueryClient=newQueryClient()constrouter=routerWithQueryClient(createTanstackRouter({
routeTree,context: {
queryClient,},scrollRestoration: true,defaultPreloadStaleTime: 0,defaultPreload: "intent",}),queryClient)returnrouter}
Screenshots or Videos
No response
Platform
OS: macOS
Browser: all
Version: 0.15.3
Additional context
No response
The text was updated successfully, but these errors were encountered:
Which project does this relate to?
Create Tanstack App
Describe the bug
When using the default configuration of TanStack Query, state is injected into all requests, even if they came from a different user. This could leak information and should not the default.
Your Example Website or App
https://github.com/Benjamin-Lee/tanstack-start-query
Steps to Reproduce the Bug or Issue
Expected behavior
There should be no server side state injected into different requests. This could be a security issue if an authenticated client runs a query which is cached on the server, which then uses that cache to inject the state for a different user.
To get the expected behavior, I have made this my
router.tsx
:Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: