Next.js dynamic routes forbidden
With next js latest version when trying to fetch data it goes forbidden :
export async function generateMetadata({ params }) { const page_slug = (await params)?.page_slug; const page = await customPageData(page_slug);
const seo = await getSEO({
title : getTitle(page?.data?.page?.name),
description: page?.data?.seo_content?.description,
keywords : page?.data?.seo_content?.keywords,
image : page?.data?.seo_image,
});
if (!page || page?.remark == 'page_not_found') {
return notFound();
}
return seo;
}