--- import SiteLayout from '../../components/SiteLayout.astro'; let error = ''; if (Astro.request.method === 'POST') { try { const data = await Astro.request.formData(); const username = data.get('username'); const password = data.get('password'); // Simple client-side auth - real auth happens in the API if (username === 'admin' && password === 'password') { // Store authentication in a cookie or localStorage in a real app return Astro.redirect('/admin'); } else { error = 'Invalid username or password'; } } catch (e) { error = 'An error occurred during login'; } } ---

Content Admin Login

{error &&
{error}
}