public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ui: login: display error messages when logging
Date: Thu, 24 Apr 2025 15:44:23 +0200	[thread overview]
Message-ID: <20250424134423.364697-1-m.sandoval@proxmox.com> (raw)

This allows to distinguish, for example, the following three cases:

 - The pvedaemon service is not responding (595)
 - The pveproxy service is not responding (no error status code)
 - The authentication credentials are not correct (401)

Since different combinations of wrong password and/or wrong user all
report the same error message: "authentication failure (401)" this does
not leak login information.

Another consideration is that the code `resp.status` does not match the
HTTP code seen in the API (a failed authentication has a return code 200
from the point of view of the browser) and its information is lost
without this change.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 www/manager6/window/LoginWindow.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/www/manager6/window/LoginWindow.js b/www/manager6/window/LoginWindow.js
index a1ba3cdb..066c053a 100644
--- a/www/manager6/window/LoginWindow.js
+++ b/www/manager6/window/LoginWindow.js
@@ -157,6 +157,14 @@ Ext.define('PVE.window.LoginWindow', {
 	    };
 
 	    let emsg = gettext("Login failed. Please try again");
+	    if (resp.status) {
+		emsg = Ext.String.format(
+		    "{0}<br>{1}<br>{2}",
+		    gettext("Login failed:"),
+		    resp.htmlStatus,
+		    gettext("Please try again"),
+		);
+	    }
 
 	    if (resp.failureType === "connect") {
 		emsg = gettext("Connection failure. Network error or Proxmox VE services not running?");
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


                 reply	other threads:[~2025-04-24 13:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250424134423.364697-1-m.sandoval@proxmox.com \
    --to=m.sandoval@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal