import { showToast } from '../components/toast.js'; import { t } from '../i18n.js'; let authConfig = null; async function loadAuthConfig() { if (authConfig) return authConfig; const res = await fetch('/api/auth/config'); authConfig = await res.json(); return authConfig; } export async function render(container) { const config = await loadAuthConfig(); const isSetup = config.needsSetup; // registration_enabled may be absent on older servers — treat as enabled for back-compat const canRegister = config.registration_enabled !== false; container.innerHTML = `
${isSetup ? t('auth.subtitle_setup') : t('auth.subtitle_signin')}
${!isSetup && canRegister ? `${t('auth.trial_notice')}
` : ''}