Code review, need advice on Auth Guarding Setup
stackblitz: https://stackblitz.com/edit/vitejs-vite-aaw7yap9?file=src%2Froutes%2Flogin.tsx
The demo isn't super functional, but it gets the gist across.
I'm trying to find a standardized setup for auth guarding authenticated routes.
This is my file structure:
I have it currently setup with supabase magic links, but that could obviously be abstracted out. I'm more concerned about the router logic. Is there anything that jumps out or seems odd, or could be improved? I'm looking to do this across multiple apps I'm building. It feels kinda bad, but I'm not sure what could be better.
The demo isn't super functional, but it gets the gist across.
I'm trying to find a standardized setup for auth guarding authenticated routes.
This is my file structure:
I have it currently setup with supabase magic links, but that could obviously be abstracted out. I'm more concerned about the router logic. Is there anything that jumps out or seems odd, or could be improved? I'm looking to do this across multiple apps I'm building. It feels kinda bad, but I'm not sure what could be better.