[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.1 Reply
xenial-blackOP•2y ago
Here's my app
Here's my validateAuth
Similar issue https://discord.com/channels/719702312431386674/1202498120387399731
I think it might be simply how I've done my
App component. Maybe I need to change out the condition for when a loader should be shown. Cause I believe the beforeLoad runs after RouterProvider is rendered.
This was my answer