{ "success": true, "message": "Login successful", "data": { "authenticated": true, "sessionId": "session-id-here" } }
Admin authentication for protected endpoints
curl -X POST http://localhost:3000/api/auth/login \ -H "Content-Type: application/json" \ -d '{"password": "your-admin-password"}'
{ "success": false, "error": "Invalid password", "code": "AUTHENTICATION_FAILED" }
// Login and store session const loginResponse = await fetch('/api/auth/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ password: 'your-admin-password' }) }); if (loginResponse.ok) { // Session cookie is automatically stored // Now you can access protected endpoints const adminData = await fetch('/api/admin'); }
ADMIN_PASSWORD