import Link from "next/link" import { redirect } from "next/navigation" import { getSessionUser } from "@/lib/session" import { acceptInvite } from "@/app/actions/team" import { Logo } from "@/components/shared/logo" import { XCircle } from "lucide-react" export const metadata = { title: "Accept Team Invite" } export default async function AcceptInvitePage({ params, }: { params: Promise<{ token: string }> }) { const { token } = await params // Require login. Bounce through /login with a next param so the user lands // back here (and the invite is accepted) after signing in. const user = await getSessionUser() if (!user) { const next = encodeURIComponent(`/team/accept/${token}`) redirect(`/login?next=${next}`) } const result = await acceptInvite(token) // On success, drop them straight into the dashboard operating under the // owner's account. if (result.ok) redirect("/dashboard") return (
{result.error}
Go to dashboard