import Link from "next/link"; import { redirect } from "next/navigation"; import { getAuthenticatedUser } from "@/lib/auth"; import { singleValue } from "@/lib/query"; import { isSetupComplete } from "@/lib/setup"; type LoginPageProps = { searchParams: Promise<{ [key: string]: string | string[] | undefined }>; }; export const dynamic = "force-dynamic"; export default async function LoginPage({ searchParams }: LoginPageProps) { if (!(await isSetupComplete())) { redirect("/setup"); } const user = await getAuthenticatedUser(); if (user) { redirect("/dashboard"); } const query = await searchParams; const error = singleValue(query.error); return (

Welcome back

After logging in, manage your YOUR channel.

{error ?
{error}
: null}
Back to channel
); }