SPB Git forge

spb/fetcha

Public
11commits 1branches 0releases
1.5 MBsize
maindefault branch
16 days agolast push
TypeScript 97.5% SQL 1.4% Python 0.8%
1.8 KB · 37 lines tsx
Raw Blame History
1import type { Metadata } from "next";2import Link from "next/link";3import { MailCheck } from "lucide-react";4import { getUser } from "@/lib/session";5import { AuthCard } from "@/components/auth/auth-card";6import { Button } from "@/components/ui/button";7import { ResendVerificationButton } from "@/components/dashboard/resend-verification";8import { Alert } from "@/components/ui/alert";910export const metadata: Metadata = { title: "Verify your email" };1112export default async function VerifyEmailPage({ searchParams }: { searchParams: Promise<{ error?: string }> }) {13  const sp = await searchParams;14  const user = await getUser();15  if (user?.emailVerified) {16    return (17      <AuthCard title="Email verified" description="Your account is fully activated.">18        <div className="flex items-center gap-3 rounded-lg border border-border bg-bg-subtle p-4 text-[13.5px]"><MailCheck className="size-5 text-success" /> Production API access is unlocked.</div>19        <Button asChild className="mt-4 w-full"><Link href="/dashboard">Go to the dashboard</Link></Button>20      </AuthCard>21    );22  }23  return (24    <AuthCard title="Verify your email" description={user ? <>We sent a link to <strong className="text-fg">{user.email}</strong>. Open it to activate production API access.</> : "Log in to resend the verification email."}>25      {sp.error ? <Alert variant="warning" className="mb-4">The verification link is invalid or expired. Request a new one below.</Alert> : null}26      {user ? (27        <div className="flex flex-col gap-2">28          <ResendVerificationButton email={user.email} variant="primary" size="default" />29          <Button asChild variant="outline"><Link href="/dashboard">Continue to the dashboard</Link></Button>30        </div>31      ) : (32        <Button asChild className="w-full"><Link href="/login">Log in</Link></Button>33      )}34    </AuthCard>35  );36}37