diff --git a/apps/web/app/ius/[slug]/conditions/page.tsx b/apps/web/app/ius/[slug]/conditions/page.tsx index a3da207..48c99ce 100644 --- a/apps/web/app/ius/[slug]/conditions/page.tsx +++ b/apps/web/app/ius/[slug]/conditions/page.tsx @@ -4,10 +4,14 @@ import type { PageProps } from '@/types/page'; import { withError } from '@/utils/error'; import { getPageUrlParams } from '@/utils/url'; import type { Metadata } from 'next'; +import { headers } from 'next/headers'; export async function generateMetadata(pageProps: PageProps): Promise { const pageUrlParams = getPageUrlParams(pageProps); - const { title } = await apiIUS.getConfig({ pageUrlParams }); + const headersList = headers(); + const cookie = headersList.get('cookie') ?? ''; + + const { title } = await apiIUS.getConfig({ cookie, pageUrlParams }); const text = `Условия: ${title} | Эволюция`; return { @@ -24,7 +28,10 @@ export default async function Page(pageProps: PageProps) { return withError({ render: async () => { const pageUrlParams = getPageUrlParams(pageProps); - const conditions = await apiIUS.getConditions({ pageUrlParams }); + const headersList = headers(); + const cookie = headersList.get('cookie') ?? ''; + + const conditions = await apiIUS.getConditions({ cookie, pageUrlParams }); return ; }, diff --git a/apps/web/app/ius/[slug]/page.tsx b/apps/web/app/ius/[slug]/page.tsx index 03951d2..df14dea 100644 --- a/apps/web/app/ius/[slug]/page.tsx +++ b/apps/web/app/ius/[slug]/page.tsx @@ -10,7 +10,10 @@ import { headers } from 'next/headers'; export async function generateMetadata(pageProps: PageProps): Promise { const pageUrlParams = getPageUrlParams(pageProps); - const { title } = await apiIUS.getConfig({ pageUrlParams }); + const headersList = headers(); + const cookie = headersList.get('cookie') ?? ''; + + const { title } = await apiIUS.getConfig({ cookie, pageUrlParams }); const text = `${title} | Эволюция`; return {