T
TanStack•2y ago
wise-white

skip beforeLoad validation

I have the following problem. My router folder has this structure - _authenticated(dir) - auth (dir) - update-password.tsx - more auth related files - dashboard(dir) - more tsx files related to this - _authenticated.tsx (file where i sue beforeLoad to check my storage if i have token or not) - __root.tsx just renders the Outlet I want all my auth related routs with this form myurl/auth/sign-in as example. I want my sign-in rout withe the prefix auth and that beforeLoad doesnt run on this specific route. Any ideas? The easy one is just move my sign-in router file to the root path under routes dir but I want the prefix "auth/" on this root. Any ideas?
2 Replies
wise-white
wise-whiteOP•2y ago
@TkDodo 🔮 any thoughts? Basically my whole spa needs auth. Im not working with context. But anyway I want to keep it ordered using folders auth / dashboard / etc
sunny-green
sunny-green•2y ago
Hello, In auth(dir), you should be able to create a index.tsx file. Just to be sure also, dashboard(dir) should be on same level as auth(dir) ?
No description

Did you find this page helpful?