TanStackT
TanStack9mo ago
9 replies
ordinary-sapphire

React Example: Start Basic Auth BUG ?

I just cloned the Tanstack Start BASIC + Auth

npx gitpick TanStack/router/tree/main/examples/react/start-basic-auth start-basic-auth
cd start-basic-auth
npm i
npm run dev

And normally, if I'm not authenticated, I don't have access to the /posts page.

Well, I don't know by what miracle, but I can access this page as normally as possible.
It shows me the login form, and a few seconds later it shows me the posts page with a bug, because when it redirects me to /posts, I don't know why, but it doesn't retrieve the data from the loader: () => fetchPosts(),

export const Route = createFileRoute("/_authed/posts")({
  loader: () => fetchPosts(),
  component: PostsComponent,
});
Was this page helpful?