diff --git a/src/app/[locale]/dashboard/page.tsx b/src/app/[locale]/dashboard/page.tsx index e1034bb..d0cb5de 100644 --- a/src/app/[locale]/dashboard/page.tsx +++ b/src/app/[locale]/dashboard/page.tsx @@ -4,6 +4,9 @@ import { redirect } from 'next/navigation'; import DashboardContent from '@/components/auth/DashboardContent'; import { createClient } from '@/lib/supabase/server'; +// Force dynamic rendering to ensure auth checks run on every request +export const dynamic = 'force-dynamic'; + type Props = { params: Promise<{ locale: string }>; }; diff --git a/src/middleware.ts b/src/middleware.ts index ccdea20..a20a7be 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -37,6 +37,9 @@ export async function middleware(request: NextRequest) { } // Continue with i18n middleware for all routes + // Note: For authenticated dashboard users, we prioritize i18n over potential + // Supabase cookie updates. getUser() is read-only and token refresh typically + // occurs during sign-in/sign-out, not during middleware checks. return intlMiddleware(request); }