From c883bee10ed40792c2ae35bdd9745649cfffa2f2 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Tue, 13 Feb 2024 14:42:56 +0000
Subject: feature: Add login page and logout button

---
 packages/web/app/page.tsx | 27 ++++++++++-----------------
 1 file changed, 10 insertions(+), 17 deletions(-)

(limited to 'packages/web/app/page.tsx')

diff --git a/packages/web/app/page.tsx b/packages/web/app/page.tsx
index ffc128a5..f467b64b 100644
--- a/packages/web/app/page.tsx
+++ b/packages/web/app/page.tsx
@@ -1,19 +1,12 @@
-import { LoginButton } from "@/components/auth/login";
-import { LogoutButton } from "@/components/auth/logout";
-import Link from "next/link";
+import { getServerAuthSession } from "@/server/auth";
+import { redirect } from "next/navigation";
 
-export default function Home() {
-  return (
-    <main className="flex min-h-screen flex-col items-center justify-between p-24">
-      <div>
-        <LoginButton />
-        <br />
-        <br />
-        <LogoutButton />
-        <br />
-        <br />
-        <Link href="/bookmarks">Bookmarks</Link>
-      </div>
-    </main>
-  );
+export default async function Home() {
+  // TODO: Home currently just redirects between pages until we build a proper landing page
+  const session = await getServerAuthSession();
+  if (!session) {
+    redirect("/signin");
+  }
+
+  redirect("/dashboard/bookmarks");
 }
-- 
cgit v1.2.3-70-g09d2

