TanStackT
TanStack2y ago
4 replies
moderate-tomato

[SOLVED] beforeLoad wait for auth?

I'm using the root route with context and storing my auth in there. I'm running a validateAuth function in the beforeLoad of my protected routes. But it appears that the beforeLoad occurs faster and before my auth concludes that the user is still logged in. Is there any way to wait for the auth check to occur?

I'm having a hard time figure this out, and this results in being immediately redirected to login after refreshing the page on a protected route.
Was this page helpful?