Necessity of Auth Middleware
I'm following https://tanstack.com/start/latest/docs/framework/react/examples/start-basic-auth, on how to set up my own auth.
I noticed that in the example there is no auth middleware being used, particularly the fetchPosts and fetchPost functions.
We are only checking for user in _authed.tsx like this
My question is, do I need to add a auth middleware like the following
Before every server call in protected pages?
React TanStack Start Start Basic Auth, Example | TanStack Start Docs
An example showing how to implement Start Basic Auth, in React using TanStack Start.
1 Reply
stormy-gold•2w ago
Actually you need to guard your server functions with an auth middleware if you do not want them to be publicly accessible.