Non-redirected authentication: parallel routes
https://tanstack.com/router/latest/docs/framework/react/guide/authenticated-routes#non-redirected-authentication
This section in the docs mentions you can "choose to not redirect users to a login page, and instead keep the user on the same page and show a login form that either replaces the main content or hides it via a modal".
I'd like to present a login modal that gets triggered any time the user is unauthenticated and tries navigating to a protected route.
So it would look like:
1. User is on an unprotected page (e.g. /_landing/index.tsx)
2. User clicks <Link> hitting the layout route /_protected/dashboard/route.tsx
3. /_protected/dashboard/route.tsx beforeLoad runs and redirects with route masking to a /sign-in route that is implemented as a modal without <Outlet>
Based on what the docs say I would imagine that the content of the unprotected page would still show because there is no <Outlet> rendered, but instead only the sign-in modal is rendered.
Is this expected, and am I misinterpreting the docs? It seems this situation would call for parallel routes which I don't believe are implemented yet right?
0 Replies