Display different content depending on whether one is authenticated or not
Hey there!
I've used https://tanstack.com/router/latest/docs/framework/react/guide/authenticated-routes and file-based routing with great success in a React app with a straightforward directory and file structure:
I am now building an app where--ideally--I would like to have
But according to https://tanstack.com/router/latest/docs/framework/react/guide/route-matching this would always match
Have you solved this (or a similar) problem? How did you solve it?
Thanks for your help.
I am now building an app where--ideally--I would like to have
mysite.com/foo render differently based on whether one is authenticated or not. My first thought was that I might be able to solve it like this:But according to https://tanstack.com/router/latest/docs/framework/react/guide/route-matching this would always match
_authed/foo first and never try foo.Have you solved this (or a similar) problem? How did you solve it?
Thanks for your help.