import { createFileRoute } from "@tanstack/react-router"; import { useState } from "react"; import { z } from "zod"; import { verifyEmail } from "~/fns/login"; import { useAction } from "~/hooks/use-action"; import { AuthCard } from "~/components/AuthCard"; import { Button } from "~/ui/Button"; import { ErrorBanner } from "~/ui/Callout"; import { TextLink } from "~/ui/TextLink"; export const Route = createFileRoute("/verify-email")({ validateSearch: z.object({ token: z.string().optional() }), head: () => ({ meta: [{ title: "Verify email ยท gitfor" }] }), component: VerifyEmailPage, }); /** Verification needs an explicit click so link scanners in mail clients can't consume the token. */ function VerifyEmailPage() { const { token } = Route.useSearch(); const action = useAction(verifyEmail); const [verified, setVerified] = useState(null); return ( {verified ? (

{verified} is verified.

Go to settings
) : (
)}
); }