From ab8b726fee9a82ba98c550a151988c86dc096efd Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Fri, 17 Oct 2025 09:43:56 +0000
Subject: (대표님) 데이터룸 관련 개발사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/login/login-form.tsx | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

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

diff --git a/components/login/login-form.tsx b/components/login/login-form.tsx
index 36687096..751e45f4 100644
--- a/components/login/login-form.tsx
+++ b/components/login/login-form.tsx
@@ -99,12 +99,12 @@ export function LoginForm() {
     useEffect(() => {
         if (status === 'authenticated' && session?.user) {
             const callbackUrlParam = searchParams?.get('callbackUrl');
-            
+
             if (callbackUrlParam) {
                 try {
                     // URL 객체로 파싱
                     const callbackUrl = new URL(callbackUrlParam);
-                    
+
                     // pathname + search만 사용 (호스트 제거)
                     const relativeUrl = callbackUrl.pathname + callbackUrl.search;
                     router.push(relativeUrl);
@@ -113,8 +113,13 @@ export function LoginForm() {
                     router.push(callbackUrlParam);
                 }
             } else {
-                // callbackUrl이 없으면 기본 대시보드로 리다이렉트
-                router.push(`/${lng}/partners/dashboard`);
+                if (session.user.ownerCompanyId) {
+                    router.push(`/${lng}/partners/data-room`);
+
+                } else {
+                    router.push(`/${lng}/partners/dashboard`);
+
+                }
             }
         }
     }, [status, session, router, lng, searchParams]);
@@ -130,7 +135,7 @@ export function LoginForm() {
     // 세분화된 에러 메시지 처리 함수
     const getErrorMessage = (error: { errorCode?: string; message?: string }, provider: 'email' | 'sgips') => {
         const errorCode = error.errorCode;
-        
+
         if (!errorCode) {
             return error.message || t('authenticationFailed');
         }
@@ -270,7 +275,7 @@ export function LoginForm() {
         const targetUserId = userIdParam || mfaUserId;
         const targetEmail = emailParam || mfaUserEmail;
         const targetUserName = userNameParam || mfaUserName;
-        
+
         if (!targetUserId || mfaCountdown > 0) return;
 
         setIsSmsLoading(true);
@@ -359,7 +364,7 @@ export function LoginForm() {
                 }
             } else {
                 let errorMessage = t('invalidAuthCode');
-                
+
                 if (result?.error) {
                     switch (result.error) {
                         case 'CredentialsSignin':
@@ -676,7 +681,7 @@ export function LoginForm() {
             setPassword('');
             setUsername('');
         }
-        
+
         // S-Gips 관련 초기화
         setSelectedOtpUser(null);
         setShowUserSelectionDialog(false);
-- 
cgit v1.2.3

