26 lines
847 B
TypeScript
26 lines
847 B
TypeScript
/**
|
|
* @file app/(main)/dashboard/page.tsx
|
|
* @description 로그인 사용자 전용 대시보드 페이지(Server Component)
|
|
*/
|
|
|
|
import { redirect } from "next/navigation";
|
|
import { DashboardContainer } from "@/features/dashboard/components/DashboardContainer";
|
|
import { createClient } from "@/utils/supabase/server";
|
|
|
|
/**
|
|
* 대시보드 페이지
|
|
* @returns DashboardContainer UI
|
|
* @see features/dashboard/components/DashboardContainer.tsx 대시보드 상태 헤더/지수/보유종목 UI를 제공합니다.
|
|
*/
|
|
export default async function DashboardPage() {
|
|
// 상태 정의: 서버에서 세션을 먼저 확인해 비로그인 접근을 차단합니다.
|
|
const supabase = await createClient();
|
|
const {
|
|
data: { user },
|
|
} = await supabase.auth.getUser();
|
|
|
|
if (!user) redirect("/login");
|
|
|
|
return <DashboardContainer />;
|
|
}
|