import { notFound } from "next/navigation"; import { cookies, headers } from "next/headers"; import { resolveLocale, t } from "../../lib/i18n"; type Props = { searchParams: { token?: string }; }; export default async function VerifyPage({ searchParams }: Props) { const token = searchParams.token; if (!token) { notFound(); } const cookieStore = await cookies(); const headerList = await headers(); const locale = resolveLocale({ cookieLocale: cookieStore.get("locale")?.value, acceptLanguage: headerList.get("accept-language"), }); const translate = (key: any) => t(locale, key as any); const res = await fetch( `${process.env.APP_URL ?? "http://localhost:3000"}/api/auth/verify`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ token }), cache: "no-store", }, ); const ok = res.ok; return (

{translate("verifyTitle")}

{ok ? (

{translate("verifyOk")}

) : (

{translate("verifyFail")}

)}
); }