[feat]: Shadcn UI 모달 Select 레이아웃 시프트 방지 및 코드 정리
주요 변경사항:
- 테마/언어 선택을 모달 스타일로 변경 (native={false})
- LoginPage, SignupPage, DashboardLayout 적용
- CSS 2줄로 레이아웃 시프트 완전 제거
- body { overflow: visible !important }
- body[data-scroll-locked] { margin-right: 0 !important }
- 미사용 business 컴포넌트 대량 삭제 (코드 정리)
- CEODashboard → MainDashboard 이름 변경
- 구현 문서 작성: [IMPL-2025-11-12] modal-select-layout-shift-fix.md
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -21,17 +21,26 @@ export function useAuthGuard() {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
console.log('🔄 useAuthGuard: Starting auth check...');
|
||||
|
||||
// 페이지 로드 시 인증 확인
|
||||
const checkAuth = async () => {
|
||||
try {
|
||||
console.log('📡 Fetching /api/auth/check...');
|
||||
// 🔵 Next.js 내부 API - 쿠키에서 토큰 확인 (PHP 호출 X, 성능 최적화)
|
||||
const response = await fetch('/api/auth/check', {
|
||||
method: 'GET',
|
||||
cache: 'no-store',
|
||||
});
|
||||
|
||||
console.log('📥 Response status:', response.status);
|
||||
|
||||
if (!response.ok) {
|
||||
// 인증 실패 시 로그인 페이지로 이동
|
||||
console.log('⚠️ 인증 실패: 로그인 페이지로 이동');
|
||||
router.replace('/login');
|
||||
} else {
|
||||
console.log('✅ 인증 성공');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('❌ 인증 확인 오류:', error);
|
||||
@@ -56,5 +65,5 @@ export function useAuthGuard() {
|
||||
return () => {
|
||||
window.removeEventListener('pageshow', handlePageShow);
|
||||
};
|
||||
}, [router]);
|
||||
}, []);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user