Re-add redirect for unauthenticated users on home page
This commit is contained in:
@@ -5,11 +5,17 @@ import GlobalSearch from '@/components/GlobalSearch'
|
|||||||
import EmptyState from '@/components/EmptyState'
|
import EmptyState from '@/components/EmptyState'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { auth } from '@/auth'
|
import { auth } from '@/auth'
|
||||||
|
import { redirect } from 'next/navigation'
|
||||||
|
|
||||||
export const dynamic = 'force-dynamic'
|
export const dynamic = 'force-dynamic'
|
||||||
|
|
||||||
export default async function Home() {
|
export default async function Home() {
|
||||||
const session = await auth()
|
const session = await auth()
|
||||||
|
|
||||||
|
if (!session?.user) {
|
||||||
|
redirect('/auth/login')
|
||||||
|
}
|
||||||
|
|
||||||
const lists = await getLists()
|
const lists = await getLists()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user