Fix login redirect to chat after authentication

- Change default redirect from '/' to '/#chat' after successful login
- Ensures users go directly to chat interface instead of root
This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-02-04 12:52:47 -03:00
parent e135ebf2e6
commit 375b457f48

View file

@ -1264,12 +1264,18 @@
// Successful login - redirect
if (response.redirect || response.success) {
window.location.href = response.redirect || "/";
// Check for redirect parameter in URL
const urlParams = new URLSearchParams(window.location.search);
const redirectUrl = urlParams.get('redirect') || response.redirect || "/#chat";
window.location.href = redirectUrl;
}
} catch (e) {
// If response is not JSON, check for redirect header
if (event.detail.xhr.status === 200) {
window.location.href = "/";
// Check for redirect parameter in URL
const urlParams = new URLSearchParams(window.location.search);
const redirectUrl = urlParams.get('redirect') || "/#chat";
window.location.href = redirectUrl;
}
}
} else {