ofj3kso
Auth guard
Hey there. I was trying to find a good solution to handle authentication and set up a guard that will redirect users to the authentication page if they are not authenticated.
While reading this discussion (https://github.com/solidjs/solid-router/discussions/364), I couldn't help but notice this comment
"This has the 2nd most upvotes of all time with no response"
I didn't like so much the solutions, I want to propose mine and get @ryansolid comment on it, as I feel like this is an area with room for improvement, but I'm aware my solution might have blind spots or limitations I haven't considered
---
Optional: Lazy Loading Components
Benefits if you choose to use lazy loading:
- Reduces initial bundle size
- Improves initial load time
8 replies