diff --git a/frontend/src/features/auth/DemoQuickLogin.tsx b/frontend/src/features/auth/DemoQuickLogin.tsx index c60c75a..6d87d48 100644 --- a/frontend/src/features/auth/DemoQuickLogin.tsx +++ b/frontend/src/features/auth/DemoQuickLogin.tsx @@ -26,8 +26,24 @@ export const DEMO_ACCOUNTS: DemoAccount[] = [ { account: 'viewer', password: 'view12345!', roleLabelKey: 'demo.viewer' }, ]; +/** + * 데모 계정 퀵 로그인 노출 조건: + * 1. 빌드 환경변수 VITE_SHOW_DEMO_LOGIN=true (로컬 개발 우선) + * 2. 로컬 개발 호스트 (localhost/127.0.0.1) + * 3. 데모 배포 호스트 (kcg-ai-monitoring.gc-si.dev — 현재 데모 운영 중이므로 노출) + * + * 실운영 호스트로 전환 시 3번 조건을 제거하거나 hostname 목록에서 제외. + */ +const DEMO_ALLOWED_HOSTS = [ + 'localhost', + '127.0.0.1', + 'kcg-ai-monitoring.gc-si.dev', +]; + export function isDemoLoginEnabled(): boolean { - return import.meta.env.VITE_SHOW_DEMO_LOGIN === 'true'; + if (import.meta.env.VITE_SHOW_DEMO_LOGIN === 'true') return true; + if (typeof window === 'undefined') return false; + return DEMO_ALLOWED_HOSTS.includes(window.location.hostname); } interface DemoQuickLoginProps {