Merge pull request 'release: DemoQuickLogin hostname 대응' (#15) from develop into main
All checks were successful
Build and Deploy KCG AI Monitoring (Frontend) / build-and-deploy (push) Successful in 16s

This commit is contained in:
htlee 2026-04-08 06:59:04 +09:00
커밋 8ccae2fee5

파일 보기

@ -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 {