import type { Metadata } from "next"; import { getTranslations } from "next-intl/server"; import { resetPassword } from "@/actions/password-reset"; import Link from "@/components/link"; import { ContentCard } from "@/components/public/ui"; export async function generateMetadata(): Promise { const t = await getTranslations("pages.reset"); return { title: t("title"), description: t("subtitle"), // Single-use links: never indexable. robots: { index: false, follow: false }, }; } const ERROR_KEYS: Record = { password: "passwordMinLength", ratelimit: "tooManyAttempts", invalid: "invalidLink", failed: "failed", }; export default async function ResetPage({ searchParams, }: { searchParams: Promise<{ email?: string; token?: string; error?: string }>; }) { const t = await getTranslations("pages.reset"); const { email = "", token = "", error } = await searchParams; // Only codes the action can produce are mapped — anything else stays silent // instead of being echoed back onto our own domain. const errorKey = error ? (ERROR_KEYS[error] ?? null) : null; return (
{errorKey ? (

{t(errorKey)}

) : null}

{t("backToLogin")}

); }