Error
This commit is contained in:
@@ -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
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user