From da6606ef891d8498a4479cadb82e270e52b19166 Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Tue, 11 Nov 2025 15:48:50 +0900
Subject: (김준회) 세션 로딩 애니메이션이 5초 이상 지속되면 쿠키삭제 힌트
 보이도록 가이드 처리
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/login/login-form.tsx | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

(limited to 'components/login/login-form.tsx')

diff --git a/components/login/login-form.tsx b/components/login/login-form.tsx
index 70a1e775..5fe6ab51 100644
--- a/components/login/login-form.tsx
+++ b/components/login/login-form.tsx
@@ -21,6 +21,7 @@ import {
 import { requestPasswordResetAction } from "@/lib/users/auth/partners-auth";
 import { checkEmailAndStartAuth, resendEmailOtp } from "@/lib/users/auth/email-auth";
 import Loading from "../common/loading/loading";
+import Animation from "../common/loading/animation";
 import { VideoBackground } from "./video-background";
 
 export function LoginForm() {
@@ -37,6 +38,8 @@ export function LoginForm() {
     // 상태 관리
     const [isFirstAuthLoading, setIsFirstAuthLoading] = useState(false);
     const [showForgotPassword, setShowForgotPassword] = useState(false);
+    const [loadingStartTime, setLoadingStartTime] = useState<number | null>(null);
+    const [showCookieHint, setShowCookieHint] = useState(false);
 
     // MFA 관련 상태
     const [showMfaForm, setShowMfaForm] = useState(false);
@@ -78,6 +81,24 @@ export function LoginForm() {
         }
     }, []);
 
+    // 세션 로딩 시간 추적 및 쿠키 힌트 표시
+    useEffect(() => {
+        if (status === 'loading') {
+            if (!loadingStartTime) {
+                setLoadingStartTime(Date.now());
+            }
+            // 5초 후 쿠키 힌트 표시
+            const timer = setTimeout(() => {
+                setShowCookieHint(true);
+            }, 5000);
+            return () => clearTimeout(timer);
+        } else {
+            // 로딩이 끝나면 초기화
+            setLoadingStartTime(null);
+            setShowCookieHint(false);
+        }
+    }, [status, loadingStartTime]);
+
     // // 영문 페이지에서 S-Gips 로그인 비활성화 시 기본 로그인 방법 설정
     // useEffect(() => {
     //     if (lng === 'en' && loginMethod === 'sgips') {
@@ -543,7 +564,23 @@ export function LoginForm() {
     // 세션 로딩 중이거나 이미 인증된 상태에서는 로딩 표시
     if (status === 'loading') {
         return (
-            <Loading message={t('loading')} />
+            <div className="container relative flex h-screen flex-col items-center justify-center">
+                <div className="flex items-center space-x-2">
+                    <span className="text-md font-bold">eVCP</span>
+                </div>
+                <div>
+                    <Animation />
+                </div>
+                <div className="mt-4 text-sm text-muted-foreground">{t('loading')}</div>
+                {showCookieHint && (
+                    <div className="mt-4 text-xs text-destructive bg-muted/50 p-3 rounded-lg border border-border max-w-md text-center">
+                        <div className="font-medium mb-1 text-foreground">Loading taking longer than expected?</div>
+                        <div className="text-muted-foreground">
+                            Try pressing <kbd className="px-1 py-0.5 bg-muted text-muted-foreground rounded text-xs border">Ctrl+Shift+Delete</kbd> to clear cookies and refresh the page.
+                        </div>
+                    </div>
+                )}
+            </div>
         );
     }
 
-- 
cgit v1.2.3

