diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-11 15:48:50 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-11 15:48:50 +0900 |
| commit | da6606ef891d8498a4479cadb82e270e52b19166 (patch) | |
| tree | 95f557fb99095235d60bebf67f72aaa29e402468 /components/login/login-form.tsx | |
| parent | e207799f1c1a058853f9fa6ad151dc61317a93c1 (diff) | |
(김준회) 세션 로딩 애니메이션이 5초 이상 지속되면 쿠키삭제 힌트 보이도록 가이드 처리
Diffstat (limited to 'components/login/login-form.tsx')
| -rw-r--r-- | components/login/login-form.tsx | 39 |
1 files changed, 38 insertions, 1 deletions
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> ); } |
