From ff33729aba078ecfa0f1d3c0995e4d4a37eeb608 Mon Sep 17 00:00:00 2001 From: Emilio Date: Fri, 12 Sep 2025 12:35:33 -0600 Subject: [PATCH] Error --- src/app/page.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) 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 }, []);