From ae309d64c4bcd2e7512d4b6ed2ea6dc785e511de Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sun, 4 Feb 2024 21:13:04 +0100 Subject: [PATCH] WebClient: disable indicator if we redirect from the login page Signed-off-by: Nicola Murino --- internal/httpd/server.go | 2 ++ internal/httpd/web.go | 1 + templates/common/baselogin.html | 13 ++++++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/internal/httpd/server.go b/internal/httpd/server.go index 720ffa2b..1557bdd6 100644 --- a/internal/httpd/server.go +++ b/internal/httpd/server.go @@ -173,6 +173,7 @@ func (s *httpdServer) renderClientLoginPage(w http.ResponseWriter, r *http.Reque CSRFToken: createCSRFToken(ip), Branding: s.binding.Branding.WebClient, FormDisabled: s.binding.isWebClientLoginFormDisabled(), + CheckRedirect: true, } if next := r.URL.Query().Get("next"); strings.HasPrefix(next, webClientFilesPath) { data.CurrentURL += "?next=" + url.QueryEscape(next) @@ -599,6 +600,7 @@ func (s *httpdServer) renderAdminLoginPage(w http.ResponseWriter, r *http.Reques CSRFToken: createCSRFToken(ip), Branding: s.binding.Branding.WebAdmin, FormDisabled: s.binding.isWebAdminLoginFormDisabled(), + CheckRedirect: false, } if s.binding.showClientLoginURL() { data.AltLoginURL = webClientLoginPath diff --git a/internal/httpd/web.go b/internal/httpd/web.go index 01326fb3..9d21e253 100644 --- a/internal/httpd/web.go +++ b/internal/httpd/web.go @@ -69,6 +69,7 @@ type loginPage struct { Title string Branding UIBranding FormDisabled bool + CheckRedirect bool } type twoFactorPage struct { diff --git a/templates/common/baselogin.html b/templates/common/baselogin.html index fc2e5739..7bcf63d3 100644 --- a/templates/common/baselogin.html +++ b/templates/common/baselogin.html @@ -59,9 +59,16 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).