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: {