diff --git a/frontend/src/lib/api.js b/frontend/src/lib/api.js
index 1cabe5d..e94beef 100644
--- a/frontend/src/lib/api.js
+++ b/frontend/src/lib/api.js
@@ -22,12 +22,18 @@ api.interceptors.response.use(
return response;
},
(error) => {
+ // Si es un error 401 (No autorizado)
if (error.response && error.response.status === 401) {
localStorage.removeItem('token');
localStorage.removeItem('user');
- window.location.href = '/login';
+
+ // SOLUCIÓN: Solo recargamos y redirigimos si NO estamos ya en /login
+ if (window.location.pathname !== '/login') {
+ window.location.href = '/login';
+ }
}
-
+
+ // Propagamos el error para que los componentes puedan leer backendData
if (error.response && error.response.data) {
return Promise.reject({
...error,
diff --git a/frontend/src/pages/History.jsx b/frontend/src/pages/History.jsx
index 6947934..8dea8b1 100644
--- a/frontend/src/pages/History.jsx
+++ b/frontend/src/pages/History.jsx
@@ -2,6 +2,7 @@ import { useState, useEffect } from 'react';
import { Link } from 'react-router-dom';
import { getUserHistory, deleteHistoryItem } from '../services/docService';
import Step3FinalGraph from '../components/editor/Step3FinalGraph';
+import { FiEye, FiTrash2, FiBarChart2, FiInbox, FiClock } from 'react-icons/fi';
export default function History() {
const [historyItems, setHistoryItems] = useState([]);
@@ -64,12 +65,13 @@ export default function History() {
{/* Lista de Historial */}
{isLoading ? (
-
⏳
-
Cargando tus gráficas...
+
+
Cargando tus gráficas...
+
) : historyItems.length === 0 ? (
-
📭
+
Aún no has guardado ningún modelo.
Ve al editor, crea una gráfica y dale a "Guardar".
@@ -86,7 +88,7 @@ export default function History() {
- 📊
+
{item.name || 'Modelo sin título'}
@@ -111,7 +113,7 @@ export default function History() {
className="px-4 py-2.5 bg-white border border-red-200 text-red-500 font-bold rounded-xl hover:bg-red-50 transition-colors shadow-sm"
title="Borrar modelo"
>
- Borrar
+
diff --git a/frontend/src/pages/Login.jsx b/frontend/src/pages/Login.jsx
index 8f3ff7a..a119649 100644
--- a/frontend/src/pages/Login.jsx
+++ b/frontend/src/pages/Login.jsx
@@ -2,7 +2,7 @@ import { useState, useEffect, useRef } from 'react';
import { Link, useNavigate, useSearchParams } from 'react-router-dom';
import { useAuth } from '../context/AuthContext';
import { authService } from '../services/authService';
-import EyeIcon from '../components/EyeIcon';
+import { FiEye, FiEyeOff } from 'react-icons/fi';
export default function Login() {
const [email, setEmail] = useState('');
@@ -70,7 +70,7 @@ export default function Login() {
};
return (
-
+
@@ -108,7 +108,11 @@ export default function Login() {
onClick={() => setShowPassword(!showPassword)}
className="absolute right-4 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors focus:outline-none"
>
-
+ {showPassword ? (
+
+ ) : (
+
+ )}
diff --git a/frontend/src/pages/Register.jsx b/frontend/src/pages/Register.jsx
index cdc38fc..fc66b73 100644
--- a/frontend/src/pages/Register.jsx
+++ b/frontend/src/pages/Register.jsx
@@ -2,7 +2,7 @@ import { useState } from 'react';
import { useNavigate, Link } from 'react-router-dom';
import { useAuth } from '../context/AuthContext';
import { authService } from '../services/authService';
-import EyeIcon from '../components/EyeIcon';
+import { FiEye, FiEyeOff } from 'react-icons/fi';
export default function Register() {
const [username, setUsername] = useState('');
@@ -37,7 +37,7 @@ export default function Register() {
};
return (
-
+
@@ -58,7 +58,7 @@ export default function Register() {
type="text" required autoComplete="username"
className="w-full px-5 py-3 rounded-2xl border border-slate-200 focus:ring-2 focus:ring-blue-500 outline-none transition-all bg-slate-50 focus:bg-white"
value={username} onChange={(e) => setUsername(e.target.value)}
- placeholder="Ej: usuario99"
+ placeholder="Ej: alexis99"
/>
@@ -86,7 +86,11 @@ export default function Register() {
type="button" onClick={() => setShowPassword(!showPassword)}
className="absolute right-4 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors focus:outline-none"
>
-
+ {showPassword ? (
+
+ ) : (
+
+ )}
@@ -105,7 +109,11 @@ export default function Register() {
type="button" onClick={() => setShowConfirmPassword(!showConfirmPassword)}
className="absolute right-4 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors focus:outline-none"
>
-
+ {showConfirmPassword ? (
+
+ ) : (
+
+ )}