From 5e10222a9435c24e348caac156f088f3a1b15087 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Wed, 4 Feb 2026 13:20:14 -0300 Subject: [PATCH] Fix login redirect to use absolute URL - Use window.location.origin for redirect to ensure it works from any path - Redirects to chat (#chat) after successful authentication - Maintains support for custom redirect parameter --- ui/suite/auth/login.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/suite/auth/login.html b/ui/suite/auth/login.html index 355c0d4..43a31d1 100644 --- a/ui/suite/auth/login.html +++ b/ui/suite/auth/login.html @@ -1266,16 +1266,16 @@ if (response.redirect || response.success) { // 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; + const redirectUrl = urlParams.get('redirect') || response.redirect; + window.location.href = redirectUrl ? redirectUrl : window.location.origin + "/#chat"; } } catch (e) { // If response is not JSON, check for redirect header if (event.detail.xhr.status === 200) { // Check for redirect parameter in URL const urlParams = new URLSearchParams(window.location.search); - const redirectUrl = urlParams.get('redirect') || "/#chat"; - window.location.href = redirectUrl; + const redirectUrl = urlParams.get('redirect'); + window.location.href = redirectUrl ? redirectUrl : window.location.origin + "/#chat"; } } } else {