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:
@@ -52,6 +52,7 @@ import {
|
||||
import { FormField } from "../molecules/FormField";
|
||||
import { getFinishedGoods, calculateBomBulk, getSiteNames, type FinishedGoods, type BomCalculationResult } from "./actions";
|
||||
import { getClients } from "../accounting/VendorManagement/actions";
|
||||
import { isNextRedirectError } from "@/lib/utils/redirect-error";
|
||||
import type { Vendor } from "../accounting/VendorManagement";
|
||||
import type { BomMaterial, CalculationResults } from "./types";
|
||||
|
||||
@@ -214,6 +215,7 @@ export function QuoteRegistration({
|
||||
toast.error(`완제품 목록 로드 실패: ${result.error}`);
|
||||
}
|
||||
} catch (error) {
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
toast.error("완제품 목록을 불러오는데 실패했습니다.");
|
||||
} finally {
|
||||
setIsLoadingProducts(false);
|
||||
@@ -234,6 +236,7 @@ export function QuoteRegistration({
|
||||
toast.error(`거래처 목록 로드 실패: ${result.error}`);
|
||||
}
|
||||
} catch (error) {
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
toast.error("거래처 목록을 불러오는데 실패했습니다.");
|
||||
} finally {
|
||||
setIsLoadingClients(false);
|
||||
@@ -251,6 +254,7 @@ export function QuoteRegistration({
|
||||
setSiteNames(result.data);
|
||||
}
|
||||
} catch (error) {
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
// 현장명 로드 실패는 무시 (선택적 기능)
|
||||
console.error("현장명 목록 로드 실패:", error);
|
||||
}
|
||||
@@ -347,6 +351,7 @@ export function QuoteRegistration({
|
||||
);
|
||||
onBack();
|
||||
} catch (error) {
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
toast.error("저장 중 오류가 발생했습니다.");
|
||||
} finally {
|
||||
setIsSaving(false);
|
||||
@@ -514,6 +519,7 @@ export function QuoteRegistration({
|
||||
toast.error(`견적 산출 실패: ${result.error || "알 수 없는 오류"}`);
|
||||
}
|
||||
} catch (error) {
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error("견적 산출 오류:", error);
|
||||
toast.error("견적 산출 중 오류가 발생했습니다.");
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user