Looking for best way to re-validate route data after some arbitrary amount of time.
Hi all, good morning/afternoon/night. So, i have a routed component with nested routes that share a single resource, that is a logged in user's metadata, like so:
The data loading function:
The router setup:
The Dashboard component:
Everything works as expected, and i love solids efficiency of the dashboard component never rerendering, only its subroutes whenever the client access them and it's really easy to access the same info in any of the subroutes.
My question is as follows: Since the dashboard component is only ever going to render once, and the route data is only ever loaded once per that route access, how would be the most efficient way of re-fetching/re-validating that data after, let's say, an hour? Since i also use that data to determine if the user is authenticated or not, and the JWT is supposed to expire in an hour, i want him to be logged out once that happens.
0 Replies