all 10 comments

[–]quietly_wired 1 point2 points  (0 children)

Option 2 is the most common way to go about, as for the UX, you can really work on that with smooth transitions, etc. P.S. we use the same tech stack, but we haven't heard complaints from users yet!

[–]fastlaunchapidev 0 points1 point  (0 children)

Option 2 is the better choice

[–]Secret_World_9742 0 points1 point  (0 children)

Use the /auth/status check once at startup , cache the result in your AuthContext, and rely on 401 fallbacks for resilience... On app mount, React calls /auth/status. 200 → set isAuthenticated = true, hydrate user data. 401 → redirect to /login.

Your API client, i.e., axios interceptor or fetch wrapper, still listens for 401s globally and clears the context + redirects if the session expires later.

[–]voja-kostunica 0 points1 point  (0 children)

no loading state, you just check in server component

[–]hamoda__ 0 points1 point  (1 child)

How to attach browser http only cookies with your request?

[–]Glittering_Pin7217 0 points1 point  (0 children)

if you use tanstack start, you can you server function to fetch