diff --git a/apps/website/src/components/Settings.astro b/apps/website/src/components/Settings.astro new file mode 100644 index 0000000..257b943 --- /dev/null +++ b/apps/website/src/components/Settings.astro @@ -0,0 +1,40 @@ + diff --git a/apps/website/src/pages/auth/login.astro b/apps/website/src/pages/auth/login.astro index fa7fb8e..9598ec1 100644 --- a/apps/website/src/pages/auth/login.astro +++ b/apps/website/src/pages/auth/login.astro @@ -1,5 +1,7 @@ --- import Layout from "~/layouts/Layout.astro"; + +export const prerender = true; --- diff --git a/apps/website/src/pages/auth/logout.astro b/apps/website/src/pages/auth/logout.astro index a2b38b3..eb95095 100644 --- a/apps/website/src/pages/auth/logout.astro +++ b/apps/website/src/pages/auth/logout.astro @@ -1,5 +1,7 @@ --- import Layout from "~/layouts/Layout.astro"; + +export const prerender = true; --- diff --git a/apps/website/src/pages/dashboard/index.astro b/apps/website/src/pages/dashboard/index.astro index c181eb0..cbb93ab 100644 --- a/apps/website/src/pages/dashboard/index.astro +++ b/apps/website/src/pages/dashboard/index.astro @@ -2,7 +2,9 @@ import { getSession } from "auth-astro/server"; const session = await getSession(Astro.request); -console.log(session); +if (!session) { + return Astro.redirect("/auth/login"); +} --- -{session ?

Welcome {session.user?.name}

:

Not logged in

} +

Welcome {session.user?.name}

diff --git a/apps/website/src/pages/index.astro b/apps/website/src/pages/index.astro index 5a9ab2d..fa5021e 100644 --- a/apps/website/src/pages/index.astro +++ b/apps/website/src/pages/index.astro @@ -2,8 +2,11 @@ import Layout from "~/layouts/Layout.astro"; import Invite from "~/components/Invite.astro"; import Computer from "~/components/Computer.astro"; +import Settings from "~/components/Settings.astro"; import Logo from "~/assets/logo.png"; import { Image } from "astro:assets"; + +export const prerender = true; --- @@ -32,15 +35,22 @@ import { Image } from "astro:assets";