refactor: 로그아웃 및 캐시 정리 로직 개선

- AuthContext 로그아웃 함수를 완전한 캐시 정리 방식으로 개선
- 새로운 logout 유틸리티 추가 (Zustand, sessionStorage, localStorage, 서버 API 통합)
- DashboardLayout → AuthenticatedLayout 이름 변경
- masterDataStore 캐시 정리 기능 강화
- protected 라우트 레이아웃 참조 업데이트

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
byeongcheolryu
2025-12-15 09:21:43 +09:00
parent c026130a65
commit 8457dba0fc
8 changed files with 277 additions and 31 deletions

View File

@@ -10,7 +10,7 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
* Protected Group Error Boundary
*
* 특징:
* - DashboardLayout 자동 적용 (사이드바, 헤더 포함)
* - AuthenticatedLayout 자동 적용 (사이드바, 헤더 포함)
* - 보호된 경로 내 에러만 포착
* - 인증된 사용자를 위한 친근한 에러 UI
*/

View File

@@ -1,7 +1,7 @@
"use client";
import { useAuthGuard } from '@/hooks/useAuthGuard';
import DashboardLayout from '@/layouts/DashboardLayout';
import AuthenticatedLayout from '@/layouts/AuthenticatedLayout';
import { RootProvider } from '@/contexts/RootProvider';
/**
@@ -32,7 +32,7 @@ export default function ProtectedLayout({
// 🎨 모든 하위 페이지에 공통 레이아웃 및 Context 적용
return (
<RootProvider>
<DashboardLayout>{children}</DashboardLayout>
<AuthenticatedLayout>{children}</AuthenticatedLayout>
</RootProvider>
);
}

View File

@@ -4,10 +4,10 @@ import { PageLoadingSpinner } from '@/components/ui/loading-spinner';
* Protected Group Loading UI
*
* 특징:
* - DashboardLayout 내에서 표시됨 (사이드바, 헤더 유지)
* - AuthenticatedLayout 내에서 표시됨 (사이드바, 헤더 유지)
* - React Suspense 자동 적용
* - 페이지 전환 시 즉각적인 피드백
* - 대시보드 스타일로 통일
* - 공통 레이아웃 스타일로 통일
*/
export default function ProtectedLoading() {
return (

View File

@@ -7,7 +7,7 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
* Protected Group 404 Not Found Page
*
* 특징:
* - DashboardLayout 자동 적용 (사이드바, 헤더 포함)
* - AuthenticatedLayout 자동 적용 (사이드바, 헤더 포함)
* - 인증된 사용자만 볼 수 있음
* - 보호된 경로 내에서 404 발생 시 표시
*/