fix(WEB): 토큰 만료 시 무한 로딩 대신 로그인 리다이렉트 처리

- 52개 이상의 컴포넌트에 isNextRedirectError 처리 추가
- Server Action의 redirect() 에러가 catch 블록에서 삼켜지는 문제 해결
- access_token + refresh_token 모두 만료 시 정상적으로 로그인 페이지로 리다이렉트

수정된 영역:
- accounting: 10개 컴포넌트
- production: 12개 컴포넌트
- hr: 5개 컴포넌트
- settings: 8개 컴포넌트
- approval: 5개 컴포넌트
- items: 20개+ 컴포넌트
- board: 5개 컴포넌트
- quality: 4개 컴포넌트
- material, outbound, quotes 등 기타 컴포넌트

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
byeongcheolryu
2026-01-11 17:19:11 +09:00
parent 8bc4b90fe9
commit e56b7d53a4
131 changed files with 3320 additions and 1979 deletions

View File

@@ -31,6 +31,7 @@ import type { ItemType, BendingDetail } from '@/types/item';
import type { ItemFieldResponse } from '@/types/item-master-api';
import { uploadItemFile, ItemFileType, checkItemCodeDuplicate, DuplicateCheckResult } from '@/lib/api/items';
import { DuplicateCodeError } from '@/lib/api/error-handler';
import { isNextRedirectError } from '@/lib/utils/redirect-error';
/**
* 메인 DynamicItemForm 컴포넌트
@@ -356,6 +357,7 @@ export default function DynamicItemForm({
});
console.log('[DynamicItemForm] 전개도 파일 업로드 성공');
} catch (error) {
if (isNextRedirectError(error)) throw error;
console.error('[DynamicItemForm] 전개도 파일 업로드 실패:', error);
fileUploadErrors.push('전개도 이미지');
}
@@ -372,6 +374,7 @@ export default function DynamicItemForm({
});
console.log('[DynamicItemForm] 시방서 파일 업로드 성공');
} catch (error) {
if (isNextRedirectError(error)) throw error;
console.error('[DynamicItemForm] 시방서 파일 업로드 실패:', error);
fileUploadErrors.push('시방서');
}
@@ -402,6 +405,7 @@ export default function DynamicItemForm({
});
console.log('[DynamicItemForm] 인정서 파일 업로드 성공');
} catch (error) {
if (isNextRedirectError(error)) throw error;
console.error('[DynamicItemForm] 인정서 파일 업로드 실패:', error);
fileUploadErrors.push('인정서');
}
@@ -1025,6 +1029,7 @@ export default function DynamicItemForm({
setBendingDiagramFile(file);
console.log('[DynamicItemForm] 드로잉 캔버스 → File 변환 성공:', file.name);
} catch (error) {
if (isNextRedirectError(error)) throw error;
console.error('[DynamicItemForm] 드로잉 캔버스 → File 변환 실패:', error);
}

View File

@@ -37,6 +37,7 @@ import {
} from '@/components/ui/command';
import { Check, Package, Plus, Search, Trash2, Loader2 } from 'lucide-react';
import type { BOMLine, BOMSearchState, DynamicSection } from '../types';
import { isNextRedirectError } from '@/lib/utils/redirect-error';
/**
* 품목 유형(FG, PT, SM, RM, CS)을 BOM child_item_type으로 변환
@@ -138,6 +139,7 @@ export default function DynamicBOMSection({
setSearchResults((prev) => ({ ...prev, [lineId]: mappedItems }));
}
} catch (error) {
if (isNextRedirectError(error)) throw error;
console.error('품목 검색 실패:', error);
setSearchResults((prev) => ({ ...prev, [lineId]: [] }));
} finally {