Panel admin propio: gestión de noticias
- lib/admin.ts: isAdmin(session) por allowlist ADMIN_EMAILS (normalizada) o gmlevel de AzerothCore (account_access, resiliente si no existe). ADMIN_EMAILS/ADMIN_GMLEVEL en .env.local. - lib/admin-news.ts: listNews / createNews / deleteNews (home_noticia). - Routes /api/admin/news (POST, guard isAdmin) y /api/admin/news/[id] (DELETE). - Páginas /admin (dashboard) y /admin/news (protegidas: no-admin -> redirect). AdminNewsManager (cliente: crear + listar + borrar). Verificado: /admin sin permiso redirige, APIs 403; el pipeline crear noticia -> se renderiza en la home (SSR) funciona. Turnstile bloquea el login por curl (correcto). Pendiente admin: precios de servicios, foros, sitios de voto, usuarios. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -265,5 +265,22 @@
|
||||
"loginToPost": "Sign in to participate.",
|
||||
"emptyError": "Fill in all fields.",
|
||||
"genericError": "Something went wrong. Please try again later."
|
||||
},
|
||||
"Admin": {
|
||||
"title": "Admin panel",
|
||||
"dashboard": "Dashboard",
|
||||
"news": "News",
|
||||
"manageNews": "Manage news",
|
||||
"newsTitle": "Title",
|
||||
"newsContent": "Content (HTML)",
|
||||
"newsLink": "Link (optional)",
|
||||
"create": "Create news",
|
||||
"creating": "Creating…",
|
||||
"delete": "Delete",
|
||||
"confirmDelete": "Delete this news item?",
|
||||
"noNews": "No news.",
|
||||
"forbidden": "You do not have permission to access here.",
|
||||
"emptyError": "Fill in the title and content.",
|
||||
"genericError": "Something went wrong."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,5 +265,22 @@
|
||||
"loginToPost": "Inicia sesión para participar.",
|
||||
"emptyError": "Completa todos los campos.",
|
||||
"genericError": "Algo ha salido mal. Inténtalo más tarde."
|
||||
},
|
||||
"Admin": {
|
||||
"title": "Panel de administración",
|
||||
"dashboard": "Panel",
|
||||
"news": "Noticias",
|
||||
"manageNews": "Gestionar noticias",
|
||||
"newsTitle": "Título",
|
||||
"newsContent": "Contenido (HTML)",
|
||||
"newsLink": "Enlace (opcional)",
|
||||
"create": "Crear noticia",
|
||||
"creating": "Creando…",
|
||||
"delete": "Borrar",
|
||||
"confirmDelete": "¿Borrar esta noticia?",
|
||||
"noNews": "No hay noticias.",
|
||||
"forbidden": "No tienes permiso para acceder aquí.",
|
||||
"emptyError": "Completa el título y el contenido.",
|
||||
"genericError": "Algo ha salido mal."
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user