fix: audit 89 bugs - critical fixes
CRITICAL: - JwtMiddleware orden (antes de UseAuthentication) - JWT Secret en appsettings.json (no vacio) - Transbank MySQL connection string (User=root + placeholder) - package-lock generado + Dockerfile usa npm install - Tests E2E: selectores corregidos con name attributes - Tests: rut invalido reemplazado, casos sin auth - Contacto page: apunta a services-externos (no backend) - .env.example: credenciales reales -> placeholders HIGH: - extra_hosts agregado a services-externos en compose - Dockerfile frontend: npm ci -> npm install
This commit is contained in:
@@ -1,21 +1,30 @@
|
||||
'use client';
|
||||
|
||||
import { useState, FormEvent } from 'react';
|
||||
import { api } from '@/services/api';
|
||||
|
||||
const SERVICES_URL = process.env.NEXT_PUBLIC_SERVICES_URL || 'http://localhost:5001/api';
|
||||
|
||||
export default function ContactoPage() {
|
||||
const [mail, setMail] = useState('');
|
||||
const [mensaje, setMensaje] = useState('');
|
||||
const [enviando, setEnviando] = useState(false);
|
||||
|
||||
const handleSubmit = async (e: FormEvent) => {
|
||||
e.preventDefault();
|
||||
setEnviando(true);
|
||||
try {
|
||||
await api.post('/email/send', { to: mail, subject: 'Contacto desde SAM', body: mensaje });
|
||||
await fetch(`${SERVICES_URL}/email/send`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ to: mail, subject: 'Contacto desde SAM', body: mensaje }),
|
||||
});
|
||||
alert('Correo enviado');
|
||||
setMail('');
|
||||
setMensaje('');
|
||||
} catch {
|
||||
alert('Error al enviar');
|
||||
} finally {
|
||||
setEnviando(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user