import { showToast } from '../components/toast.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 ? 'Create your admin account to get started' : 'Sign in to manage your displays'}
${!isSetup && canRegister ? 'New accounts get a 14-day free Pro trial
' : ''}