+8
-7
@@ -4,7 +4,6 @@ import { HydrateClient } from "~/trpc/server";
|
||||
import FileGrid from "~/app/_components/FileGrid";
|
||||
import UploadForm from "~/app/_components/UploadForm";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { signIn, signOut } from "next-auth/react";
|
||||
|
||||
export default async function Home() {
|
||||
const session = await auth();
|
||||
@@ -43,12 +42,14 @@ export default async function Home() {
|
||||
)}
|
||||
{!session?.user && (
|
||||
<div className="flex flex-col items-center gap-2">
|
||||
<button
|
||||
onClick={() => (session ? signOut() : signIn())}
|
||||
className="rounded-full bg-white/10 px-10 py-3 font-semibold no-underline transition hover:bg-white/20"
|
||||
>
|
||||
{session ? "Sign out" : "Sign in"}
|
||||
</button>
|
||||
<div className="flex flex-col items-center justify-center gap-4">
|
||||
<Link
|
||||
href={session ? "/api/auth/signout" : "/api/auth/signin"}
|
||||
className="rounded-full bg-white/10 px-10 py-3 font-semibold no-underline transition hover:bg-white/20"
|
||||
>
|
||||
{session ? "Sign out" : "Sign in"}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user