Skip to content

Commit b655459

Browse files
techgangbossclaude
andcommitted
fix: share page renders meta tags before redirect so Twitter shows OG card
The previous redirect() sent a 307 before Twitter's crawler could read the meta tags. Now renders a minimal HTML page with meta tags + a <meta http-equiv="refresh"> for client-side redirect. Crawlers read the OG/Twitter meta, humans get redirected to the swap page. Also added robots noindex since this page exists only for share cards. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9c09631 commit b655459

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/app/share/preconfirm/page.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Metadata } from "next"
2-
import { redirect } from "next/navigation"
32

43
interface Props {
54
searchParams: Promise<{ time?: string }>
@@ -28,10 +27,16 @@ export async function generateMetadata({ searchParams }: Props): Promise<Metadat
2827
images: [ogUrl],
2928
site: "@Fast_Protocol",
3029
},
30+
robots: { index: false },
3131
}
3232
}
3333

34-
/** Redirect visitors to the main swap page — this route only exists for OG meta. */
35-
export default async function SharePreconfirmPage() {
36-
redirect("/")
34+
/**
35+
* Renders a minimal page so crawlers (Twitter, Facebook) can read the meta tags.
36+
* Human visitors get a client-side redirect to the swap page.
37+
*/
38+
export default function SharePreconfirmPage() {
39+
return (
40+
<meta httpEquiv="refresh" content="0;url=/" />
41+
)
3742
}

0 commit comments

Comments
 (0)