From eaa2b5699029e00e13f0f1068cdc0643523df2de Mon Sep 17 00:00:00 2001 From: Kasper Birch Date: Thu, 2 Jan 2025 14:47:40 +0100 Subject: [PATCH] fix: Remove unused token variable The `token` variable is not in use and is a leftover from commit `d8c106cb2b8fa157d2ea545991abd1d851a733ec`. --- examples/draft-preview/src/app/(app)/next/preview/route.ts | 2 -- templates/website/src/app/(frontend)/next/preview/route.ts | 2 -- .../src/app/(frontend)/next/preview/route.ts | 2 -- 3 files changed, 6 deletions(-) diff --git a/examples/draft-preview/src/app/(app)/next/preview/route.ts b/examples/draft-preview/src/app/(app)/next/preview/route.ts index da133e64d9d..5716aa7a423 100644 --- a/examples/draft-preview/src/app/(app)/next/preview/route.ts +++ b/examples/draft-preview/src/app/(app)/next/preview/route.ts @@ -6,7 +6,6 @@ import { getPayload } from 'payload' import configPromise from '../../../../payload.config' -const payloadToken = 'payload-token' export async function GET( req: { @@ -18,7 +17,6 @@ export async function GET( } & Request, ): Promise { const payload = await getPayload({ config: configPromise }) - const token = req.cookies.get(payloadToken)?.value const { searchParams } = new URL(req.url) const path = searchParams.get('path') const collection = searchParams.get('collection') as CollectionSlug diff --git a/templates/website/src/app/(frontend)/next/preview/route.ts b/templates/website/src/app/(frontend)/next/preview/route.ts index 80642637c05..e927d4c5501 100644 --- a/templates/website/src/app/(frontend)/next/preview/route.ts +++ b/templates/website/src/app/(frontend)/next/preview/route.ts @@ -4,7 +4,6 @@ import { getPayload, type PayloadRequest } from 'payload' import configPromise from '@payload-config' import { CollectionSlug } from 'payload' -const payloadToken = 'payload-token' export async function GET( req: Request & { @@ -16,7 +15,6 @@ export async function GET( }, ): Promise { const payload = await getPayload({ config: configPromise }) - const token = req.cookies.get(payloadToken)?.value const { searchParams } = new URL(req.url) const path = searchParams.get('path') const collection = searchParams.get('collection') as CollectionSlug diff --git a/templates/with-vercel-website/src/app/(frontend)/next/preview/route.ts b/templates/with-vercel-website/src/app/(frontend)/next/preview/route.ts index 80642637c05..e927d4c5501 100644 --- a/templates/with-vercel-website/src/app/(frontend)/next/preview/route.ts +++ b/templates/with-vercel-website/src/app/(frontend)/next/preview/route.ts @@ -4,7 +4,6 @@ import { getPayload, type PayloadRequest } from 'payload' import configPromise from '@payload-config' import { CollectionSlug } from 'payload' -const payloadToken = 'payload-token' export async function GET( req: Request & { @@ -16,7 +15,6 @@ export async function GET( }, ): Promise { const payload = await getPayload({ config: configPromise }) - const token = req.cookies.get(payloadToken)?.value const { searchParams } = new URL(req.url) const path = searchParams.get('path') const collection = searchParams.get('collection') as CollectionSlug