diff --git a/src/app/page.tsx b/src/app/page.tsx index ad25bd3..51f048e 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -36,6 +36,7 @@ const Home = () => { useEffect(() => { const params = new URLSearchParams(window.location.search); const token = params.get("token"); + const error = params.get("error"); if (token) { localStorage.setItem("token", token); @@ -45,6 +46,14 @@ const Home = () => { const cleanUrl = window.location.origin + window.location.pathname; window.history.replaceState({}, document.title, cleanUrl); } + if (error) { + // Aquí decides cómo manejarlo + alert("Error de inicio de sesión: NO AUTORIZADO"); + + // Si quieres limpiar la URL después + const cleanUrl = window.location.origin + window.location.pathname; + window.history.replaceState({}, document.title, cleanUrl); + } setTokenProcessed(true); // ✅ Ya procesamos token }, []);