From 85956201999079c2340856c428a0601015530a9b Mon Sep 17 00:00:00 2001 From: Atridad Lahiji <88056492+atridadl@users.noreply.github.com> Date: Wed, 31 May 2023 16:49:11 -0600 Subject: [PATCH 1/3] Added the same redirect logic to /admin --- src/pages/admin/index.tsx | 4 ++-- src/pages/profile/index.tsx | 2 +- src/pages/room/[id].tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/admin/index.tsx b/src/pages/admin/index.tsx index 0f76bb6..446a0f7 100644 --- a/src/pages/admin/index.tsx +++ b/src/pages/admin/index.tsx @@ -13,11 +13,11 @@ import type { Role } from "~/utils/types"; export const getServerSideProps: GetServerSideProps = async (ctx) => { const session = await getServerAuthSession(ctx); - // Redirect to home if not logged in + // Redirect to login if not signed in if (!session) { return { redirect: { - destination: "/", + destination: `/api/auth/signin?callbackUrl=${ctx.resolvedUrl}`, permanent: false, }, }; diff --git a/src/pages/profile/index.tsx b/src/pages/profile/index.tsx index 69b87c6..5d5e90f 100644 --- a/src/pages/profile/index.tsx +++ b/src/pages/profile/index.tsx @@ -14,7 +14,7 @@ import { FaGithub, FaGoogle } from "react-icons/fa"; export const getServerSideProps: GetServerSideProps = async (ctx) => { const session = await getServerAuthSession(ctx); - // Redirect to home if not logged in + // Redirect to login if not signed in if (!session) { return { redirect: { diff --git a/src/pages/room/[id].tsx b/src/pages/room/[id].tsx index 5853123..4a4e21f 100644 --- a/src/pages/room/[id].tsx +++ b/src/pages/room/[id].tsx @@ -33,7 +33,7 @@ import { downloadCSV } from "~/utils/helpers"; export const getServerSideProps: GetServerSideProps = async (ctx) => { const session = await getServerAuthSession(ctx); - // Redirect to home if not logged in + // Redirect to login if not signed in if (!session) { return { redirect: { From fb85aa2187d10548ae6e17efa3e303c6e3dd22a1 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji <88056492+atridadl@users.noreply.github.com> Date: Wed, 31 May 2023 21:49:25 -0600 Subject: [PATCH 2/3] UX updates... the main page is now fully static :) --- src/components/Footer.tsx | 2 +- src/components/Loading.tsx | 2 +- src/components/Navbar.tsx | 36 ++++++++-- src/pages/dashboard/index.tsx | 102 +++++++++++++++++++++++++++ src/pages/index.tsx | 129 +++++++--------------------------- 5 files changed, 159 insertions(+), 112 deletions(-) create mode 100644 src/pages/dashboard/index.tsx diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 5a8e30b..da01f72 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -3,7 +3,7 @@ import packagejson from "../../package.json"; const Footer: React.FC = () => { return ( -