Where to protect SolidStart routes?
I tried layouts, but it loads data only once per page if I'm right, so if user gets logged out it doesn't react
I tried middleware like in here https://start.solidjs.com/advanced/middleware, but it didn't re-load either, so am I doing something wrong (I'm not the sharpest tool) or is there a better way?
1 Reply
I'm assuming you're using
routeData
to handle data fetching. You can provide a key which will trigger a re-execution.
https://start.solidjs.com/api/createRouteData#fetching-data-with-a-key
I hope this helps