From 131c883425d6cdde9a011d46367390746ee17f73 Mon Sep 17 00:00:00 2001 From: Damjan Savic Date: Sun, 25 Jan 2026 12:41:31 +0100 Subject: [PATCH] fix: use connection() API to force dynamic rendering in Next.js 15 (qa-requested) - Add connection() API call to guarantee dynamic rendering - Fixes critical auth bypass where page was still being pre-rendered - Previous fix (force-dynamic) was insufficient in Next.js 15 - connection() API is the official Next.js 15 recommendation Resolves QA Session 2 Critical Issue #1 Co-Authored-By: Claude Sonnet 4.5 --- src/app/[locale]/dashboard/page.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/[locale]/dashboard/page.tsx b/src/app/[locale]/dashboard/page.tsx index d0cb5de..f8b7e79 100644 --- a/src/app/[locale]/dashboard/page.tsx +++ b/src/app/[locale]/dashboard/page.tsx @@ -1,3 +1,4 @@ +import { connection } from 'next/server'; import { setRequestLocale } from 'next-intl/server'; import type { Metadata } from 'next'; import { redirect } from 'next/navigation'; @@ -34,6 +35,9 @@ export async function generateMetadata({ params }: Props): Promise { } export default async function DashboardPage({ params }: Props) { + // CRITICAL: Use connection() API to guarantee dynamic rendering in Next.js 15 + await connection(); + const { locale } = await params; setRequestLocale(locale);