// Debug API endpoint to check SMTP config server-side // This will work even without client authentication import { db } from '@/lib/firebase'; import { doc, getDoc } from 'firebase/firestore'; export async function GET() { try { const configDoc = await getDoc(doc(db, 'config', 'smtp')); if (configDoc.exists()) { const config = configDoc.data(); return Response.json({ found: true, host: config?.host, port: config?.port, secure: config?.secure, user: config?.user ? 'SET' : 'MISSING', pass: config?.pass ? 'SET' : 'MISSING', from: config?.from, hasAllFields: !!(config?.host && config?.port && config?.user && config?.pass && config?.from) }); } else { return Response.json({ found: false, error: 'SMTP config not found' }); } } catch (error: any) { return Response.json({ error: error.message }); } }