From e9b7a2f582852ef74f05be227f7ae117ea0f1582 Mon Sep 17 00:00:00 2001 From: Marco Date: Fri, 28 Aug 2026 12:58:10 +0000 Subject: [PATCH] Add /sticker/[code] legacy QR redirect route + placeholder /sticker page Mirrors app/r/[code]/route.ts's Payload Redirects lookup under the fixed /sticker prefix already printed on existing sticker QR codes, so those stay admin-editable/toggleable in the same collection instead of needing a code-level static redirect. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01G5mssdCBir9kyXTmqBjV3h --- app/sticker/[code]/route.ts | 19 ++++++++++++ app/sticker/page.tsx | 59 +++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 app/sticker/[code]/route.ts create mode 100644 app/sticker/page.tsx diff --git a/app/sticker/[code]/route.ts b/app/sticker/[code]/route.ts new file mode 100644 index 0000000..661521e --- /dev/null +++ b/app/sticker/[code]/route.ts @@ -0,0 +1,19 @@ +import { redirect, notFound } from "next/navigation"; +import { NextRequest } from "next/server"; +import { resolveAndTrackRedirect } from "../../lib/payload"; + +// Legacy sticker QR codes already printed as https://einfach-produktiv.com/sticker/ +// before the /r/[code] short-link scheme existed — can't be reprinted, so +// this mirrors app/r/[code]/route.ts's exact lookup (same Redirects +// collection, matched by `code`) under the fixed /sticker prefix instead. +// Keeps a single admin-editable/toggleable source of truth for both. +export async function GET(_request: NextRequest, { params }: { params: Promise<{ code: string }> }) { + const { code } = await params; + const targetPath = await resolveAndTrackRedirect(code); + + if (!targetPath || !targetPath.startsWith("/") || targetPath.startsWith("//")) { + notFound(); + } + + redirect(targetPath); +} diff --git a/app/sticker/page.tsx b/app/sticker/page.tsx new file mode 100644 index 0000000..14cb21e --- /dev/null +++ b/app/sticker/page.tsx @@ -0,0 +1,59 @@ +import type { Metadata } from "next"; +import Link from "next/link"; +import { Reveal } from "../components/Reveal"; +import { Footer } from "../components/Footer"; +import { TrustRow } from "../components/TrustRow"; + +// Placeholder landing page for the /sticker/[code] QR redirects (see that +// route) — targetPath for those Redirects docs currently points here until +// a dedicated campaign page exists; swap targetPath in Payload once it does. +export const metadata: Metadata = { + title: "Schön, dass du da bist", + description: "Du hast einen einfach produktiv Sticker gescannt.", +}; + +export default function StickerPage() { + return ( + <> +
+ +
+ +
+

+ Schön, dass du da bist! +

+

+ Du hast einen unserer Sticker entdeckt. +

+
+ +
+

Hallo,

+

+ schön, dass dich der Sticker hierher geführt hat. Schau dich gerne um – hier + findest du alles, was einfach produktiv ausmacht. +

+
+ + + Jetzt stöbern + + + +
+