diff --git a/src/lib/session.ts b/src/lib/session.ts index 5311e3fda..55976bc13 100644 --- a/src/lib/session.ts +++ b/src/lib/session.ts @@ -18,10 +18,16 @@ export async function getSession(req: NextApiRequestCollect): Promise { + // Find website + const website = await fetchWebsite(websiteId); + + if (!website) { + throw new Error(`Website not found: ${websiteId}.`); + } +};