Added the same redirect logic to /admin

This commit is contained in:
Atridad Lahiji 2023-05-31 16:49:11 -06:00 committed by atridadl
parent 050d6d3a98
commit 625c09e105
No known key found for this signature in database
3 changed files with 4 additions and 4 deletions

View file

@ -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,
},
};

View file

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

View file

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