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%
608 B · 14 lines tsx
Raw Blame History
1import type { Metadata } from "next";2import { redirect } from "next/navigation";3import { getUser } from "@/lib/session";4import { LoginForm } from "./login-form";56export const metadata: Metadata = { title: "Log in" };78export default async function LoginPage({ searchParams }: { searchParams: Promise<{ next?: string; verified?: string; reset?: string }> }) {9  const sp = await searchParams;10  const user = await getUser();11  if (user) redirect(sp.next && sp.next.startsWith("/") ? sp.next : "/dashboard");12  return <LoginForm next={sp.next} verified={sp.verified === "1"} reset={sp.reset === "1"} />;13}14