import { parseConfirmTarget, requestOrigin, SIGN_IN_CALLBACK_PATH, } from "@/lib/signin-link"; import type { Metadata } from "next"; import { headers } from "next/headers"; import { Suspense } from "react"; import { AuthShell, primaryButton } from "../../_components/auth-shell"; export const metadata: Metadata = { title: "Sign in — SchemaTax", robots: { index: false, follow: false }, referrer: "no-referrer", }; export default function ConfirmPage({ searchParams, }: PageProps<"/signin/confirm">) { return ( Sign in to SchemaTax } > ); } async function Confirm({ searchParams, }: Pick, "searchParams">) { const { url } = await searchParams; const target = parseConfirmTarget( typeof url === "string" ? url : undefined, requestOrigin(await headers()), ); if (!target) { return ( <>

This link can’t be used

It may have been cut off when it was copied. Open the link straight from the email, or ask for a new one.

Ask for a new link ); } return ( <>

Sign in to SchemaTax as{" "} {target.email}

Nothing happens until you press the button.

{/* A form, not a link: only a person pressing it spends the single-use token. */}
{target.params.map(([name, value]) => ( ))}
); }