Loading...
Loading...
Loading...
asked 6 months ago
1
40
I’m working on a SaaS dashboard using Next.js 14 App Router.
The dashboard needs to:
/api/me)/api/analytics)My current approach:
The issue: This works, but:
401 and the UI just shows an error — I want it to redirect to /login automatically on both SSR and client.Question:
1
0
Hey, great setup so far! Let's refine it for efficiency. I'll cover your key questions step by step.
Fetch analytics on the server in your page component and pass it as a prop to the client component. This hydrates the initial data without re-fetching on the client.
This cuts the initial client fetch.