import type { Metadata } from "next"; import { headers } from "next/headers"; import { getTranslations } from "next-intl/server"; import { requestReset } from "@/actions/password-reset"; import { CaptchaWidget } from "@/components/auth/captcha-widget"; import Link from "@/components/link"; import { ContentCard } from "@/components/public/ui"; import { captchaConfig } from "@/lib/services/captcha"; export async function generateMetadata(): Promise { const t = await getTranslations("pages.forgot"); return { title: t("title"), description: t("subtitle"), robots: { index: false, follow: false }, }; } export default async function ForgotPage({ searchParams, }: { searchParams: Promise<{ sent?: string; error?: string }>; }) { const t = await getTranslations("pages.forgot"); const { sent, error } = await searchParams; const cfg = await captchaConfig(); const nonce = (await headers()).get("x-nonce") ?? undefined; return (
{sent ? ( <>

{t("sentNotice")}

{/* A mail that never arrived must be retryable from here, otherwise the visitor is stuck on a dead end. */}
) : (
{error === "captcha" ? (

{t("errorCaptcha")}

) : null} )}

{t("backToLogin")}

); }