From 8af272fd1432af556631f8364f13df6dc74a32fc Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 17 Dec 2019 14:45:13 +0100 Subject: [PATCH] ui: show login window if we get a 401 auth exception Signed-off-by: Thomas Lamprecht --- www/MainView.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/www/MainView.js b/www/MainView.js index b9e3450d..7d8c66df 100644 --- a/www/MainView.js +++ b/www/MainView.js @@ -101,6 +101,14 @@ Ext.define('PBS.MainView', { me.lookupReference('usernameinfo').update({username:Proxmox.UserName}); + // show login on requestexception + // fixme: what about other errors + Ext.Ajax.on('requestexception', function(conn, response, options) { + if (response.status == 401) { // auth failure + me.logout(); + } + }); + // get ticket periodically Ext.TaskManager.start({ run: function() {