import type { Metadata } from "next"; import Link from "next/link"; import { Logo } from "@/components/SiteHeader"; import { BACKEND_URL } from "@/lib/server"; import type { PublicConfig } from "@/lib/types"; import { SetPasswordForm } from "./SetPasswordForm"; export const metadata: Metadata = { title: "Jelszó megadása", robots: { index: false } }; async function minLength(): Promise { try { const res = await fetch(`${BACKEND_URL}/v1/config`, { cache: "no-store" }); if (res.ok) return ((await res.json()) as PublicConfig).password_min_length; } catch { // backend down: the form still works, the backend checks the length } return 10; } /** The page of the e-mailed password link (sign-up and forgotten password). */ export default async function SetPasswordPage({ searchParams, }: { searchParams: Promise>; }) { const params = await searchParams; const raw = Array.isArray(params.token) ? params.token[0] : params.token; const token = raw && /^[A-Za-z0-9_-]{8,200}$/.test(raw) ? raw : null; return (

Jelszó megadása

Add meg a jelszavad, amellyel ezentúl belépsz.

{token ? ( ) : (

Hiányos a link. Nyisd meg a teljes linket a levélből, vagy kérj újat a{" "} belépésnél.

)}
); }