#ProtectedRoute with a redirect using @solidjs/router

3 messages · Page 1 of 1 (latest)

fiery oxide
#

Hi everyone. Is there a way to implement a ProtectedRoute, but with a redirect using @solidjs/router? All the examples I have seen, do something like user ? <Component /> : <Login />, but the url remains the same..

runic solar
#

Or check onMount if the user exists and call navigate from useNavigate to reroute them