Skip to content

Commit

Permalink
로그인 오류
Browse files Browse the repository at this point in the history
  • Loading branch information
ipcgrdn committed Jan 14, 2025
1 parent 8f4a6bc commit 068f54b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { cache } from 'react';
import "./globals.css";
import type { Metadata } from "next";
import { AuthProvider } from "@/contexts/auth/AuthContext";
Expand All @@ -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) {
Expand All @@ -32,7 +31,7 @@ const getUser = cache(async () => {
console.error('Failed to fetch user:', error);
return null;
}
});
};

export const metadata: Metadata = {
title: "SOFO",
Expand All @@ -52,7 +51,6 @@ export default async function RootLayout({
}: {
children: React.ReactNode;
}) {
// 캐시된 getUser 함수 사용
const user = await getUser();

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function Sidebar() {
<User className={className} />
),
label: "프로필",
href: isAuthenticated ? `/profile/${user?.uuid}` : "/",
href: isAuthenticated ? `/profile/${user?.uuid}` : "",
onClick: (e: React.MouseEvent) => {
if (!isAuthenticated) {
e.preventDefault(); // 기본 링크 이동 동작 차단
Expand Down

0 comments on commit 068f54b

Please sign in to comment.