서버 자동로그인 해제

This commit is contained in:
Macbook
2026-06-15 13:21:42 +09:00
parent 4fac987113
commit 6720a5ed46
3 changed files with 37 additions and 11 deletions
+23
View File
@@ -0,0 +1,23 @@
import { isDesktop } from './platform';
export const DEV_LOGIN_USERNAME = 'admin';
export const DEV_LOGIN_PASSWORD = 'admin123!!';
/** 로컬 dev·localhost·Desktop — 로그인 폼 admin / admin123!! 자동 입력 */
export function shouldPrefillLoginCredentials(): boolean {
if (isDesktop()) return true;
if (import.meta.env.DEV) return true;
if (typeof window !== 'undefined') {
const host = window.location.hostname;
if (host === 'localhost' || host === '127.0.0.1') return true;
}
return false;
}
export function getLoginDefaultUsername(): string {
return shouldPrefillLoginCredentials() ? DEV_LOGIN_USERNAME : '';
}
export function getLoginDefaultPassword(): string {
return shouldPrefillLoginCredentials() ? DEV_LOGIN_PASSWORD : '';
}