Make [slug] pages set "configName" cookie

Fixes #562
This commit is contained in:
ajnart
2023-01-13 18:50:40 +09:00
parent 277bb7adbd
commit 2765b6824f

View File

@@ -1,3 +1,4 @@
import { setCookie } from 'cookies-next';
import fs from 'fs'; import fs from 'fs';
import { GetServerSidePropsContext } from 'next'; import { GetServerSidePropsContext } from 'next';
import path from 'path'; import path from 'path';
@@ -38,6 +39,12 @@ export async function getServerSideProps({
} }
const config = getFrontendConfig(configName as string); const config = getFrontendConfig(configName as string);
setCookie('config-name', configName, {
req,
res,
maxAge: 60 * 60 * 24 * 30,
sameSite: 'strict',
});
return { return {
props: { props: {