Skip to content

Commit

Permalink
Remove draftMode-check in previewParams
Browse files Browse the repository at this point in the history
- Not necessary because the one cannot exist without the other
- Enables checking for previewParams in middleware (vercel/next.js#52080)
  • Loading branch information
fraxachun committed May 16, 2024
1 parent 54f7754 commit a9c8bb1
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/site/cms-site/src/sitePreview/SitePreviewUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export async function sitePreviewRoute(request: NextRequest, graphQLFetch: Graph
export async function previewParams(): Promise<SitePreviewParams | null> {
const previewScopeSigningKey = getPreviewScopeSigningKey();

if (!draftMode().isEnabled) return null;
const cookie = cookies().get("__comet_preview");
if (cookie) {
const { payload } = await jwtDecrypt<SitePreviewParams>(cookie.value, new TextEncoder().encode(previewScopeSigningKey));
Expand Down

0 comments on commit a9c8bb1

Please sign in to comment.