File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 44 fetchLikeMembers ,
55} from "../actions/likeActions" ;
66import ListsTab from "./ListsTab" ;
7+ import { auth } from "@/auth" ;
8+ import { redirect } from "next/navigation" ;
79
810export const dynamic = "force-dynamic" ;
911
@@ -12,6 +14,12 @@ export default async function ListsPage({
1214} : {
1315 searchParams : Promise < { type ?: string } > ;
1416} ) {
17+ const session = await auth ( ) ;
18+
19+ if ( ! session ?. user ?. id ) {
20+ redirect ( "/login" ) ;
21+ }
22+
1523 const params = await searchParams ;
1624 const type =
1725 params . type === "source" ||
Original file line number Diff line number Diff line change @@ -6,10 +6,18 @@ import PaginationComponent from '@/components/PaginationComponent';
66import Filters from '@/components/navbar/Filters' ;
77import { GetMemberParams } from '@/types' ;
88import EmptyState from '@/components/EmptyState' ;
9+ import { auth } from '@/auth' ;
10+ import { redirect } from 'next/navigation' ;
911
1012export default async function MembersPage ( { searchParams, } :{
1113 searchParams : Promise < GetMemberParams > ;
1214} ) {
15+ const session = await auth ( ) ;
16+
17+ if ( ! session ?. user ?. id ) {
18+ redirect ( '/login' ) ;
19+ }
20+
1321 const params = await searchParams ;
1422
1523 const { items :members , totalCount} = await getMembers ( params ) ;
You can’t perform that action at this time.
0 commit comments