Added the same redirect logic to /admin
This commit is contained in:
parent
b348bcd701
commit
8595620199
3 changed files with 4 additions and 4 deletions
|
@ -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,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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: {
|
||||
|
|
Loading…
Add table
Reference in a new issue