diff --git a/src/app/layout.tsx b/src/app/layout.tsx index a100596..c15444e 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,4 +1,3 @@ -import { cache } from 'react'; import "./globals.css"; import type { Metadata } from "next"; import { AuthProvider } from "@/contexts/auth/AuthContext"; @@ -10,7 +9,7 @@ import { ThemeProvider } from "@/contexts/theme/ThemeContext"; import { UserProvider } from "@/contexts/auth/UserContext"; // getUser를 layout 레벨에서 캐싱 -const getUser = cache(async () => { +const getUser = async () => { const accessToken = getAuthCookie(); if (!accessToken) { @@ -32,7 +31,7 @@ const getUser = cache(async () => { console.error('Failed to fetch user:', error); return null; } -}); +}; export const metadata: Metadata = { title: "SOFO", @@ -52,7 +51,6 @@ export default async function RootLayout({ }: { children: React.ReactNode; }) { - // 캐시된 getUser 함수 사용 const user = await getUser(); return ( diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index dd7ce26..844dd7b 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx @@ -57,7 +57,7 @@ export function Sidebar() { ), label: "프로필", - href: isAuthenticated ? `/profile/${user?.uuid}` : "/", + href: isAuthenticated ? `/profile/${user?.uuid}` : "", onClick: (e: React.MouseEvent) => { if (!isAuthenticated) { e.preventDefault(); // 기본 링크 이동 동작 차단