PhilippCh4ts
how do i redirect on load?
As soon as you add a direct dependency in the route component to a cache point that just threw a redirect, the navigation to that route will comply with the redirect as well.Gosh, that was it. Everything working as expected now 🥳 Thanks so much for the pointers, that’s great info!
26 replies
how do i redirect on load?
Sorry new to Solid altogether. Where exactly would I check the value of that header? On
nativeEvent
within the cache fn? Bit puzzled as to what’s happening here, I’ve tried to create a reproduction yesterday and it did in fact work as expected. So I thought maybe it had to do something with my local setup. Anyway, I’m just trying the Stackblitz example again now (not having changed anything) and the same issue is appearing https://stackblitz.com/edit/github-qbrg4x?file=src%2Froutes%2F(admin).tsx
Also downloaded this project locally, and can reproduce there too.
Edit: Not sure if related, but there is an error showing up in the console when refreshing the /manage-orders
page.
26 replies
how do i redirect on load?
Facing the same issue right now. At least according to the docs, this is supposed to work as confirmed in this thread, right? https://docs.solidjs.com/solid-start/advanced/auth#protected-routes
I have a similar implementation for an
(admin).tsx
route group, see below. It logs null
for the user object, but doesn’t redirect.
Am I missing something?
26 replies