39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
import { Suspense } from "react";
|
|
import { getServerSession } from "next-auth";
|
|
import { redirect } from "next/navigation";
|
|
import { authOptions } from "@/lib/auth";
|
|
import { LoginForm } from "@/components/auth/login-form";
|
|
import { Film } from "lucide-react";
|
|
|
|
export const metadata = {
|
|
title: "Sign in — xBid",
|
|
};
|
|
|
|
export default async function LoginPage() {
|
|
const session = await getServerSession(authOptions);
|
|
if (session) {
|
|
redirect("/");
|
|
}
|
|
|
|
return (
|
|
<div className="flex min-h-screen w-full items-center justify-center bg-background px-4">
|
|
<div className="w-full max-w-sm space-y-6">
|
|
<div className="flex flex-col items-center gap-3 text-center">
|
|
<div className="flex h-10 w-10 items-center justify-center rounded-lg bg-amber-500">
|
|
<Film className="h-5 w-5 text-black" />
|
|
</div>
|
|
<div>
|
|
<h1 className="text-lg font-semibold tracking-tight">
|
|
x<span className="text-amber-500">Bid</span>
|
|
</h1>
|
|
<p className="text-sm text-muted-foreground">Sign in to continue</p>
|
|
</div>
|
|
</div>
|
|
<Suspense fallback={null}>
|
|
<LoginForm />
|
|
</Suspense>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|