Merge pull request 'fix: DemoQuickLogin hostname 기반 노출' (#14) from feature/demo-login-hostname into develop

This commit is contained in:
htlee 2026-04-08 06:59:02 +09:00
커밋 930fbfc841

파일 보기

@ -26,8 +26,24 @@ export const DEMO_ACCOUNTS: DemoAccount[] = [
{ account: 'viewer', password: 'view12345!', roleLabelKey: 'demo.viewer' }, { 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 { 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 { interface DemoQuickLoginProps {