From 54971bb9808833654292ef164763b6ca66bb751d Mon Sep 17 00:00:00 2001 From: shadcn Date: Mon, 7 Nov 2022 16:43:59 +0400 Subject: [PATCH] fix: do not return redirect --- app/(dashboard)/dashboard/page.tsx | 2 +- app/(dashboard)/dashboard/settings/page.tsx | 2 +- app/(editor)/editor/[postId]/page.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/(dashboard)/dashboard/page.tsx b/app/(dashboard)/dashboard/page.tsx index 82dfc02..db82e1a 100644 --- a/app/(dashboard)/dashboard/page.tsx +++ b/app/(dashboard)/dashboard/page.tsx @@ -31,7 +31,7 @@ export default async function DashboardPage() { const user = await getCurrentUser() if (!user) { - return redirect(authOptions.pages.signIn) + redirect(authOptions.pages.signIn) } const posts = await getPostsForUser(user.id) diff --git a/app/(dashboard)/dashboard/settings/page.tsx b/app/(dashboard)/dashboard/settings/page.tsx index 8ef76f6..7270556 100644 --- a/app/(dashboard)/dashboard/settings/page.tsx +++ b/app/(dashboard)/dashboard/settings/page.tsx @@ -10,7 +10,7 @@ export default async function SettingsPage() { const user = await getCurrentUser() if (!user) { - return redirect(authOptions.pages.signIn) + redirect(authOptions.pages.signIn) } return ( diff --git a/app/(editor)/editor/[postId]/page.tsx b/app/(editor)/editor/[postId]/page.tsx index e279ee6..1566b2d 100644 --- a/app/(editor)/editor/[postId]/page.tsx +++ b/app/(editor)/editor/[postId]/page.tsx @@ -23,7 +23,7 @@ export default async function EditorPage({ params }: EditorPageProps) { const user = await getCurrentUser() if (!user) { - return redirect(authOptions.pages.signIn) + redirect(authOptions.pages.signIn) } const post = await getPostForUser(params.postId, user.id)