* [pve-devel] [PATCH manager] ui: login: display error messages when logging
@ 2025-04-24 13:44 Maximiliano Sandoval
0 siblings, 0 replies; only message in thread
From: Maximiliano Sandoval @ 2025-04-24 13:44 UTC (permalink / raw)
To: pve-devel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-04-24 13:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-24 13:44 [pve-devel] [PATCH manager] ui: login: display error messages when logging Maximiliano Sandoval
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox