TanStackT
TanStack2y ago
4 replies
clean-aquamarine

context of auth not persisting on browser refresh on route beforeLoad

This seems to be the same case as the provided example in the docs
https://codesandbox.io/p/devbox/github/tanstack/router/tree/main/examples/react/authenticated-routes-context?embed=1&file=%2Fsrc%2Froutes%2F__root.tsx%3A55%2C17&theme=dark
After logging in and redirecting to /dashboard, when you reload the page you get the login page one more time. I am reproducing this on my app. What is the best strategy to persist the login state in this case?
Was this page helpful?